diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 3ccd02fadd6f5..5d6e524048787 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-07-30) + +- Azure Resource Manager AzureStackHci client library for Java. This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-preview-2023-07. 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/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 49c5a0968a067..2afb2f143cc05 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. 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 AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-preview-2023-07. 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-azurestackhci - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,8 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fazurestackhci%2Fazure-resourcemanager-azurestackhci%2FREADME.png) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 949f72862f798..283a26ca3636a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -1,364 +1,710 @@ # Code snippets and samples -## ArcSettings +## GalleryImagesOperation -- [Create](#arcsettings_create) -- [CreateIdentity](#arcsettings_createidentity) -- [Delete](#arcsettings_delete) -- [GeneratePassword](#arcsettings_generatepassword) -- [Get](#arcsettings_get) -- [ListByCluster](#arcsettings_listbycluster) -- [Update](#arcsettings_update) +- [CreateOrUpdate](#galleryimagesoperation_createorupdate) +- [Delete](#galleryimagesoperation_delete) +- [GetByResourceGroup](#galleryimagesoperation_getbyresourcegroup) +- [List](#galleryimagesoperation_list) +- [ListByResourceGroup](#galleryimagesoperation_listbyresourcegroup) +- [Update](#galleryimagesoperation_update) -## Clusters +## GuestAgent -- [Create](#clusters_create) -- [CreateIdentity](#clusters_createidentity) -- [Delete](#clusters_delete) -- [GetByResourceGroup](#clusters_getbyresourcegroup) -- [List](#clusters_list) -- [ListByResourceGroup](#clusters_listbyresourcegroup) -- [Update](#clusters_update) -- [UploadCertificate](#clusters_uploadcertificate) +- [Create](#guestagent_create) +- [Delete](#guestagent_delete) +- [Get](#guestagent_get) -## Extensions +## GuestAgentsOperation -- [Create](#extensions_create) -- [Delete](#extensions_delete) -- [Get](#extensions_get) -- [ListByArcSetting](#extensions_listbyarcsetting) -- [Update](#extensions_update) +- [List](#guestagentsoperation_list) -## Operations +## HybridIdentityMetadata -- [List](#operations_list) -### ArcSettings_Create +- [Get](#hybrididentitymetadata_get) +- [List](#hybrididentitymetadata_list) + +## MarketplaceGalleryImagesOperation + +- [CreateOrUpdate](#marketplacegalleryimagesoperation_createorupdate) +- [Delete](#marketplacegalleryimagesoperation_delete) +- [GetByResourceGroup](#marketplacegalleryimagesoperation_getbyresourcegroup) +- [List](#marketplacegalleryimagesoperation_list) +- [ListByResourceGroup](#marketplacegalleryimagesoperation_listbyresourcegroup) +- [Update](#marketplacegalleryimagesoperation_update) + +## NetworkInterfacesOperation + +- [CreateOrUpdate](#networkinterfacesoperation_createorupdate) +- [Delete](#networkinterfacesoperation_delete) +- [GetByResourceGroup](#networkinterfacesoperation_getbyresourcegroup) +- [List](#networkinterfacesoperation_list) +- [ListByResourceGroup](#networkinterfacesoperation_listbyresourcegroup) +- [Update](#networkinterfacesoperation_update) + +## StorageContainersOperation + +- [CreateOrUpdate](#storagecontainersoperation_createorupdate) +- [Delete](#storagecontainersoperation_delete) +- [GetByResourceGroup](#storagecontainersoperation_getbyresourcegroup) +- [List](#storagecontainersoperation_list) +- [ListByResourceGroup](#storagecontainersoperation_listbyresourcegroup) +- [Update](#storagecontainersoperation_update) + +## VirtualHardDisksOperation + +- [CreateOrUpdate](#virtualharddisksoperation_createorupdate) +- [Delete](#virtualharddisksoperation_delete) +- [GetByResourceGroup](#virtualharddisksoperation_getbyresourcegroup) +- [List](#virtualharddisksoperation_list) +- [ListByResourceGroup](#virtualharddisksoperation_listbyresourcegroup) +- [Update](#virtualharddisksoperation_update) + +## VirtualMachineInstances + +- [CreateOrUpdate](#virtualmachineinstances_createorupdate) +- [Delete](#virtualmachineinstances_delete) +- [Get](#virtualmachineinstances_get) +- [List](#virtualmachineinstances_list) +- [Restart](#virtualmachineinstances_restart) +- [Start](#virtualmachineinstances_start) +- [Stop](#virtualmachineinstances_stop) +- [Update](#virtualmachineinstances_update) + +## VirtualNetworksOperation + +- [CreateOrUpdate](#virtualnetworksoperation_createorupdate) +- [Delete](#virtualnetworksoperation_delete) +- [GetByResourceGroup](#virtualnetworksoperation_getbyresourcegroup) +- [List](#virtualnetworksoperation_list) +- [ListByResourceGroup](#virtualnetworksoperation_listbyresourcegroup) +- [Update](#virtualnetworksoperation_update) +### GalleryImagesOperation_CreateOrUpdate ```java -/** Samples for ArcSettings Create. */ -public final class ArcSettingsCreateSamples { +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; + +/** Samples for GalleryImagesOperation CreateOrUpdate. */ +public final class GalleryImagesOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutGalleryImage.json */ /** - * Sample code: Create ArcSetting. + * Sample code: PutGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); + public static void putGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryImagesOperations() + .define("test-gallery-image") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withContainerId("Default_Container") + .withImagePath("C:\\test.vhdx") + .withOsType(OperatingSystemTypes.LINUX) + .create(); } } ``` -### ArcSettings_CreateIdentity +### GalleryImagesOperation_Delete ```java -import com.azure.core.util.Context; +/** Samples for GalleryImagesOperation Delete. */ +public final class GalleryImagesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteGalleryImage.json + */ + /** + * Sample code: DeleteGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryImagesOperations().delete("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImagesOperation_GetByResourceGroup -/** Samples for ArcSettings CreateIdentity. */ -public final class ArcSettingsCreateIdentitySamples { +```java +/** Samples for GalleryImagesOperation GetByResourceGroup. */ +public final class GalleryImagesOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetGalleryImage.json */ /** - * Sample code: Create Arc Identity. + * Sample code: GetGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); + public static void getGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryImagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE); } } ``` -### ArcSettings_Delete +### GalleryImagesOperation_List ```java -import com.azure.core.util.Context; +/** Samples for GalleryImagesOperation List. */ +public final class GalleryImagesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListGalleryImageBySubscription.json + */ + /** + * Sample code: ListGalleryImageBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryImagesOperations().list(com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for ArcSettings Delete. */ -public final class ArcSettingsDeleteSamples { +### GalleryImagesOperation_ListByResourceGroup + +```java +/** Samples for GalleryImagesOperation ListByResourceGroup. */ +public final class GalleryImagesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListGalleryImageByResourceGroup.json */ /** - * Sample code: Delete ArcSetting. + * Sample code: ListGalleryImageByResourceGroup. * * @param manager Entry point to AzureStackHciManager. */ - public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().delete("test-rg", "myCluster", "default", Context.NONE); + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryImagesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### ArcSettings_GeneratePassword +### GalleryImagesOperation_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +import java.util.HashMap; +import java.util.Map; -/** Samples for ArcSettings GeneratePassword. */ -public final class ArcSettingsGeneratePasswordSamples { +/** Samples for GalleryImagesOperation Update. */ +public final class GalleryImagesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateGalleryImage.json */ /** - * Sample code: Generate Password. + * Sample code: UpdateGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); + public static void updateGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + GalleryImages resource = + manager + .galleryImagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; } } ``` -### ArcSettings_Get +### GuestAgent_Create ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; + +/** Samples for GuestAgent Create. */ +public final class GuestAgentCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/CreateGuestAgent.json + */ + /** + * Sample code: CreateGuestAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new GuestAgentInner() + .withCredentials( + new GuestCredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) + .withProvisioningAction(ProvisioningAction.INSTALL), + com.azure.core.util.Context.NONE); + } +} +``` + +### GuestAgent_Delete -/** Samples for ArcSettings Get. */ -public final class ArcSettingsGetSamples { +```java +/** Samples for GuestAgent Delete. */ +public final class GuestAgentDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteGuestAgent.json */ /** - * Sample code: Get ArcSetting. + * Sample code: DeleteGuestAgent. * * @param manager Entry point to AzureStackHciManager. */ - public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE); + public static void deleteGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### ArcSettings_ListByCluster +### GuestAgent_Get ```java -import com.azure.core.util.Context; +/** Samples for GuestAgent Get. */ +public final class GuestAgentGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetGuestAgent.json + */ + /** + * Sample code: GetGuestAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for ArcSettings ListByCluster. */ -public final class ArcSettingsListByClusterSamples { +### GuestAgentsOperation_List + +```java +/** Samples for GuestAgentsOperation List. */ +public final class GuestAgentsOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GuestAgent_List.json */ /** - * Sample code: List ArcSetting resources by HCI Cluster. + * Sample code: GuestAgentListByVirtualMachineInstances. * * @param manager Entry point to AzureStackHciManager. */ - public static void listArcSettingResourcesByHCICluster( + public static void guestAgentListByVirtualMachineInstances( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().listByCluster("test-rg", "myCluster", Context.NONE); + manager + .guestAgentsOperations() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### ArcSettings_Update +### HybridIdentityMetadata_Get ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.io.IOException; +/** Samples for HybridIdentityMetadata Get. */ +public final class HybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetHybridIdentityMetadata.json + */ + /** + * Sample code: GetHybridIdentityMetadata. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getHybridIdentityMetadata(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .hybridIdentityMetadatas() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### HybridIdentityMetadata_List -/** Samples for ArcSettings Update. */ -public final class ArcSettingsUpdateSamples { +```java +/** Samples for HybridIdentityMetadata List. */ +public final class HybridIdentityMetadataListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/HybridIdentityMetadata_List.json */ /** - * Sample code: Patch ArcSetting. + * Sample code: HybridIdentityMetadataListByVirtualMachineInstances. * * @param manager Entry point to AzureStackHciManager. */ - public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { - ArcSetting resource = - manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE).getValue(); - resource - .update() - .withConnectivityProperties( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"enabled\":true}", Object.class, SerializerEncoding.JSON)) - .apply(); + public static void hybridIdentityMetadataListByVirtualMachineInstances( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .hybridIdentityMetadatas() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### Clusters_Create +### MarketplaceGalleryImagesOperation_CreateOrUpdate ```java -/** Samples for Clusters Create. */ -public final class ClustersCreateSamples { +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; + +/** Samples for MarketplaceGalleryImagesOperation CreateOrUpdate. */ +public final class MarketplaceGalleryImagesOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutMarketplaceGalleryImage.json */ /** - * Sample code: Create cluster. + * Sample code: PutMarketplaceGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void putMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager - .clusters() - .define("myCluster") - .withRegion("East US") + .marketplaceGalleryImagesOperations() + .define("test-marketplace-gallery-image") + .withRegion("West US2") .withExistingResourceGroup("test-rg") - .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") - .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") - .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withContainerId("Default_Container") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCloudInitDataSource(CloudInitDataSource.AZURE) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .withVersion(new GalleryImageVersion().withName("1.0.0")) .create(); } } ``` -### Clusters_CreateIdentity +### MarketplaceGalleryImagesOperation_Delete + +```java +/** Samples for MarketplaceGalleryImagesOperation Delete. */ +public final class MarketplaceGalleryImagesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteMarketplaceGalleryImage.json + */ + /** + * Sample code: DeleteMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .marketplaceGalleryImagesOperations() + .delete("test-rg", "test-marketplace-gallery-image", com.azure.core.util.Context.NONE); + } +} +``` + +### MarketplaceGalleryImagesOperation_GetByResourceGroup ```java -import com.azure.core.util.Context; +/** Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. */ +public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetMarketplaceGalleryImage.json + */ + /** + * Sample code: GetMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .marketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse( + "test-rg", "test-marketplace-gallery-image", com.azure.core.util.Context.NONE); + } +} +``` + +### MarketplaceGalleryImagesOperation_List + +```java +/** Samples for MarketplaceGalleryImagesOperation List. */ +public final class MarketplaceGalleryImagesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListMarketplaceGalleryImageBySubscription.json + */ + /** + * Sample code: ListMarketplaceGalleryImageBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listMarketplaceGalleryImageBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.marketplaceGalleryImagesOperations().list(com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for Clusters CreateIdentity. */ -public final class ClustersCreateIdentitySamples { +### MarketplaceGalleryImagesOperation_ListByResourceGroup + +```java +/** Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. */ +public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListMarketplaceGalleryImageByResourceGroup.json */ /** - * Sample code: Create cluster Identity. + * Sample code: ListMarketplaceGalleryImageByResourceGroup. * * @param manager Entry point to AzureStackHciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + public static void listMarketplaceGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.marketplaceGalleryImagesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### Clusters_Delete +### MarketplaceGalleryImagesOperation_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImages; +import java.util.HashMap; +import java.util.Map; -/** Samples for Clusters Delete. */ -public final class ClustersDeleteSamples { +/** Samples for MarketplaceGalleryImagesOperation Update. */ +public final class MarketplaceGalleryImagesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateMarketplaceGalleryImage.json */ /** - * Sample code: Delete cluster. + * Sample code: UpdateMarketplaceGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().delete("test-rg", "myCluster", Context.NONE); + public static void updateMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + MarketplaceGalleryImages resource = + manager + .marketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse( + "test-rg", "test-marketplce-gallery-image", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; } } ``` -### Clusters_GetByResourceGroup +### NetworkInterfacesOperation_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; +import java.util.Arrays; + +/** Samples for NetworkInterfacesOperation CreateOrUpdate. */ +public final class NetworkInterfacesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutNetworkInterface.json + */ + /** + * Sample code: PutNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkInterfacesOperations() + .define("test-nic") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withIpConfigurations( + Arrays + .asList( + new IpConfiguration() + .withName("ipconfig-sample") + .withProperties( + new IpConfigurationProperties() + .withSubnet(new IpConfigurationPropertiesSubnet().withId("test-vnet"))))) + .create(); + } +} +``` + +### NetworkInterfacesOperation_Delete -/** Samples for Clusters GetByResourceGroup. */ -public final class ClustersGetByResourceGroupSamples { +```java +/** Samples for NetworkInterfacesOperation Delete. */ +public final class NetworkInterfacesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteNetworkInterface.json */ /** - * Sample code: Get cluster. + * Sample code: DeleteNetworkInterface. * * @param manager Entry point to AzureStackHciManager. */ - public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE); + public static void deleteNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkInterfacesOperations().delete("test-rg", "test-nic", com.azure.core.util.Context.NONE); } } ``` -### Clusters_List +### NetworkInterfacesOperation_GetByResourceGroup ```java -import com.azure.core.util.Context; +/** Samples for NetworkInterfacesOperation GetByResourceGroup. */ +public final class NetworkInterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetNetworkInterface.json + */ + /** + * Sample code: GetNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkInterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfacesOperation_List -/** Samples for Clusters List. */ -public final class ClustersListSamples { +```java +/** Samples for NetworkInterfacesOperation List. */ +public final class NetworkInterfacesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListNetworkInterfaceBySubscription.json */ /** - * Sample code: List clusters in a given subscription. + * Sample code: ListNetworkInterfaceBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void listClustersInAGivenSubscription( + public static void listNetworkInterfaceBySubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().list(Context.NONE); + manager.networkInterfacesOperations().list(com.azure.core.util.Context.NONE); } } ``` -### Clusters_ListByResourceGroup +### NetworkInterfacesOperation_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for Clusters ListByResourceGroup. */ -public final class ClustersListByResourceGroupSamples { +/** Samples for NetworkInterfacesOperation ListByResourceGroup. */ +public final class NetworkInterfacesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListNetworkInterfaceByResourceGroup.json */ /** - * Sample code: List clusters in a given resource group. + * Sample code: ListNetworkInterfaceByResourceGroup. * * @param manager Entry point to AzureStackHciManager. */ - public static void listClustersInAGivenResourceGroup( + public static void listNetworkInterfaceByResourceGroup( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().listByResourceGroup("test-rg", Context.NONE); + manager.networkInterfacesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### Clusters_Update +### NetworkInterfacesOperation_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaces; import java.util.HashMap; import java.util.Map; -/** Samples for Clusters Update. */ -public final class ClustersUpdateSamples { +/** Samples for NetworkInterfacesOperation Update. */ +public final class NetworkInterfacesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateNetworkInterface.json */ /** - * Sample code: Update cluster. + * Sample code: UpdateNetworkInterface. * * @param manager Entry point to AzureStackHciManager. */ - public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - Cluster resource = - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") - .withDesiredProperties( - new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.ENABLED) - .withDiagnosticLevel(DiagnosticLevel.BASIC)) - .apply(); + public static void updateNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + NetworkInterfaces resource = + manager + .networkInterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } @SuppressWarnings("unchecked") @@ -374,200 +720,852 @@ public final class ClustersUpdateSamples { } ``` -### Clusters_UploadCertificate +### StorageContainersOperation_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; -import java.util.Arrays; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for Clusters UploadCertificate. */ -public final class ClustersUploadCertificateSamples { +/** Samples for StorageContainersOperation CreateOrUpdate. */ +public final class StorageContainersOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutStorageContainer.json */ /** - * Sample code: Upload certificate. + * Sample code: PutStorageContainer. * * @param manager Entry point to AzureStackHciManager. */ - public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void putStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager - .clusters() - .uploadCertificate( - "test-rg", - "myCluster", - new UploadCertificateRequest() - .withProperties( - new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), - Context.NONE); + .storageContainersOperations() + .define("Default_Container") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withPath("C:\\container_storage") + .create(); } } ``` -### Extensions_Create +### StorageContainersOperation_Delete ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; +/** Samples for StorageContainersOperation Delete. */ +public final class StorageContainersOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteStorageContainer.json + */ + /** + * Sample code: DeleteStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().delete("test-rg", "Default_Container", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for Extensions Create. */ -public final class ExtensionsCreateSamples { +### StorageContainersOperation_GetByResourceGroup + +```java +/** Samples for StorageContainersOperation GetByResourceGroup. */ +public final class StorageContainersOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetStorageContainer.json */ /** - * Sample code: Create Arc Extension. + * Sample code: GetStorageContainer. * * @param manager Entry point to AzureStackHciManager. */ - public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { + public static void getStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager - .extensions() - .define("MicrosoftMonitoringAgent") - .withExistingArcSetting("test-rg", "myCluster", "default") - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .withProtectedSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .create(); + .storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE); } } ``` -### Extensions_Delete +### StorageContainersOperation_List ```java -import com.azure.core.util.Context; +/** Samples for StorageContainersOperation List. */ +public final class StorageContainersOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListStorageContainerBySubscription.json + */ + /** + * Sample code: ListStorageContainerBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageContainersOperation_ListByResourceGroup -/** Samples for Extensions Delete. */ -public final class ExtensionsDeleteSamples { +```java +/** Samples for StorageContainersOperation ListByResourceGroup. */ +public final class StorageContainersOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListStorageContainerByResourceGroup.json */ /** - * Sample code: Delete Arc Extension. + * Sample code: ListStorageContainerByResourceGroup. * * @param manager Entry point to AzureStackHciManager. */ - public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### Extensions_Get +### StorageContainersOperation_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.StorageContainers; +import java.util.HashMap; +import java.util.Map; -/** Samples for Extensions Get. */ -public final class ExtensionsGetSamples { +/** Samples for StorageContainersOperation Update. */ +public final class StorageContainersOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateStorageContainer.json */ /** - * Sample code: Get ArcSettings Extension. + * Sample code: UpdateStorageContainer. * * @param manager Entry point to AzureStackHciManager. */ - public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager - .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + public static void updateStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + StorageContainers resource = + manager + .storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; } } ``` -### Extensions_ListByArcSetting +### VirtualHardDisksOperation_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for Extensions ListByArcSetting. */ -public final class ExtensionsListByArcSettingSamples { +/** Samples for VirtualHardDisksOperation CreateOrUpdate. */ +public final class VirtualHardDisksOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualHardDisk.json */ /** - * Sample code: List Extensions under ArcSetting resource. + * Sample code: PutVirtualHardDisk. * * @param manager Entry point to AzureStackHciManager. */ - public static void listExtensionsUnderArcSettingResource( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + public static void putVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualHardDisksOperations() + .define("test-vhd") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withDiskSizeGB(32L) + .create(); } } ``` -### Extensions_Update +### VirtualHardDisksOperation_Delete ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import java.io.IOException; - -/** Samples for Extensions Update. */ -public final class ExtensionsUpdateSamples { +/** Samples for VirtualHardDisksOperation Delete. */ +public final class VirtualHardDisksOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualHardDisk.json */ /** - * Sample code: Update Arc Extension. + * Sample code: DeleteVirtualHardDisk. * * @param manager Entry point to AzureStackHciManager. */ - public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { - Extension resource = - manager - .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) - .getValue(); - resource - .update() - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .apply(); + public static void deleteVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualHardDisksOperations().delete("test-rg", "test-vhd", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### VirtualHardDisksOperation_GetByResourceGroup ```java -import com.azure.core.util.Context; +/** Samples for VirtualHardDisksOperation GetByResourceGroup. */ +public final class VirtualHardDisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualHardDisk.json + */ + /** + * Sample code: GetVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHardDisksOperation_List -/** Samples for Operations List. */ -public final class OperationsListSamples { +```java +/** Samples for VirtualHardDisksOperation List. */ +public final class VirtualHardDisksOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualHardDiskBySubscription.json */ /** - * Sample code: Create cluster. + * Sample code: ListVirtualHardDiskBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().listWithResponse(Context.NONE); + public static void listVirtualHardDiskBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualHardDisksOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHardDisksOperation_ListByResourceGroup + +```java +/** Samples for VirtualHardDisksOperation ListByResourceGroup. */ +public final class VirtualHardDisksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualHardDisksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHardDisksOperation_Update + +```java +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualHardDisksOperation Update. */ +public final class VirtualHardDisksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualHardDisk.json + */ + /** + * Sample code: UpdateVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + VirtualHardDisks resource = + manager + .virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### VirtualMachineInstances_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk; +import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; +import java.util.Arrays; + +/** Samples for VirtualMachineInstances CreateOrUpdate. */ +public final class VirtualMachineInstancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithGalleryImage.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithOsDisk.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithOsDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithOsDisk( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withOsDisk( + new VirtualMachineInstancePropertiesStorageProfileOsDisk() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithVMConfigAgent.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithVMConfigAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithVMConfigAgent( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster") + .withWindowsConfiguration( + new VirtualMachineInstancePropertiesOsProfileWindowsConfiguration() + .withProvisionVMConfigAgent(true))) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Delete + +```java +/** Samples for VirtualMachineInstances Delete. */ +public final class VirtualMachineInstancesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualMachineInstance.json + */ + /** + * Sample code: DeleteVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Get + +```java +/** Samples for VirtualMachineInstances Get. */ +public final class VirtualMachineInstancesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualMachineInstance.json + */ + /** + * Sample code: GetVirtualMachineInstance. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualMachineInstance(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_List + +```java +/** Samples for VirtualMachineInstances List. */ +public final class VirtualMachineInstancesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualMachineInstances.json + */ + /** + * Sample code: ListVirtualMachineInstances. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineInstances( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Restart + +```java +/** Samples for VirtualMachineInstances Restart. */ +public final class VirtualMachineInstancesRestartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/RestartVirtualMachineInstance.json + */ + /** + * Sample code: RestartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Start + +```java +/** Samples for VirtualMachineInstances Start. */ +public final class VirtualMachineInstancesStartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/StartVirtualMachineInstance.json + */ + /** + * Sample code: StartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Stop + +```java +/** Samples for VirtualMachineInstances Stop. */ +public final class VirtualMachineInstancesStopSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/StopVirtualMachineInstance.json + */ + /** + * Sample code: StopVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Update + +```java +import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateProperties; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; + +/** Samples for VirtualMachineInstances Update. */ +public final class VirtualMachineInstancesUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualMachineInstance.json + */ + /** + * Sample code: UpdateVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceUpdateRequest() + .withProperties(new VirtualMachineInstanceUpdateProperties().withOsProfile(new OsProfileUpdate())), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworksOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.NetworkTypeEnum; + +/** Samples for VirtualNetworksOperation CreateOrUpdate. */ +public final class VirtualNetworksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualNetwork.json + */ + /** + * Sample code: PutVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualNetworksOperations() + .define("test-vnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withNetworkType(NetworkTypeEnum.TRANSPARENT) + .create(); + } +} +``` + +### VirtualNetworksOperation_Delete + +```java +/** Samples for VirtualNetworksOperation Delete. */ +public final class VirtualNetworksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualNetwork.json + */ + /** + * Sample code: DeleteVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().delete("test-rg", "test-vnet", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworksOperation_GetByResourceGroup + +```java +/** Samples for VirtualNetworksOperation GetByResourceGroup. */ +public final class VirtualNetworksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualNetwork.json + */ + /** + * Sample code: GetVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworksOperation_List + +```java +/** Samples for VirtualNetworksOperation List. */ +public final class VirtualNetworksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualNetworkBySubscription.json + */ + /** + * Sample code: ListVirtualNetworkBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworksOperation_ListByResourceGroup + +```java +/** Samples for VirtualNetworksOperation ListByResourceGroup. */ +public final class VirtualNetworksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ + /** + * Sample code: ListVirtualNetworkByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworksOperation_Update + +```java +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworksOperation Update. */ +public final class VirtualNetworksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualNetwork.json + */ + /** + * Sample code: UpdateVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + VirtualNetworks resource = + manager + .virtualNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index a1f5908e316c0..ce1f47acec764 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-05. + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-preview-2023-07. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index 7fa8e3fcf096e..8dd236cf089e7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java @@ -24,15 +24,27 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; -import com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsImpl; import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; -import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; -import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; -import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; -import com.azure.resourcemanager.azurestackhci.models.ArcSettings; -import com.azure.resourcemanager.azurestackhci.models.Clusters; -import com.azure.resourcemanager.azurestackhci.models.Extensions; -import com.azure.resourcemanager.azurestackhci.models.Operations; +import com.azure.resourcemanager.azurestackhci.implementation.GalleryImagesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.HybridIdentityMetadatasImpl; +import com.azure.resourcemanager.azurestackhci.implementation.MarketplaceGalleryImagesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.NetworkInterfacesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.StorageContainersOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualHardDisksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualMachineInstancesImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualNetworksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesOperations; +import com.azure.resourcemanager.azurestackhci.models.GuestAgents; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentsOperations; +import com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadatas; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesOperations; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesOperations; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstances; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksOperations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -42,13 +54,25 @@ /** Entry point to AzureStackHciManager. Azure Stack HCI management service. */ public final class AzureStackHciManager { - private ArcSettings arcSettings; + private GalleryImagesOperations galleryImagesOperations; - private Clusters clusters; + private MarketplaceGalleryImagesOperations marketplaceGalleryImagesOperations; - private Extensions extensions; + private NetworkInterfacesOperations networkInterfacesOperations; - private Operations operations; + private StorageContainersOperations storageContainersOperations; + + private VirtualHardDisksOperations virtualHardDisksOperations; + + private VirtualMachineInstances virtualMachineInstances; + + private HybridIdentityMetadatas hybridIdentityMetadatas; + + private GuestAgents guestAgents; + + private GuestAgentsOperations guestAgentsOperations; + + private VirtualNetworksOperations virtualNetworksOperations; private final AzureStackHciClient clientObject; @@ -215,7 +239,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -273,51 +297,131 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil } /** - * Gets the resource collection API of ArcSettings. It manages ArcSetting. + * Gets the resource collection API of GalleryImagesOperations. It manages GalleryImages. + * + * @return Resource collection API of GalleryImagesOperations. + */ + public GalleryImagesOperations galleryImagesOperations() { + if (this.galleryImagesOperations == null) { + this.galleryImagesOperations = + new GalleryImagesOperationsImpl(clientObject.getGalleryImagesOperations(), this); + } + return galleryImagesOperations; + } + + /** + * Gets the resource collection API of MarketplaceGalleryImagesOperations. It manages MarketplaceGalleryImages. + * + * @return Resource collection API of MarketplaceGalleryImagesOperations. + */ + public MarketplaceGalleryImagesOperations marketplaceGalleryImagesOperations() { + if (this.marketplaceGalleryImagesOperations == null) { + this.marketplaceGalleryImagesOperations = + new MarketplaceGalleryImagesOperationsImpl(clientObject.getMarketplaceGalleryImagesOperations(), this); + } + return marketplaceGalleryImagesOperations; + } + + /** + * Gets the resource collection API of NetworkInterfacesOperations. It manages NetworkInterfaces. + * + * @return Resource collection API of NetworkInterfacesOperations. + */ + public NetworkInterfacesOperations networkInterfacesOperations() { + if (this.networkInterfacesOperations == null) { + this.networkInterfacesOperations = + new NetworkInterfacesOperationsImpl(clientObject.getNetworkInterfacesOperations(), this); + } + return networkInterfacesOperations; + } + + /** + * Gets the resource collection API of StorageContainersOperations. It manages StorageContainers. + * + * @return Resource collection API of StorageContainersOperations. + */ + public StorageContainersOperations storageContainersOperations() { + if (this.storageContainersOperations == null) { + this.storageContainersOperations = + new StorageContainersOperationsImpl(clientObject.getStorageContainersOperations(), this); + } + return storageContainersOperations; + } + + /** + * Gets the resource collection API of VirtualHardDisksOperations. It manages VirtualHardDisks. + * + * @return Resource collection API of VirtualHardDisksOperations. + */ + public VirtualHardDisksOperations virtualHardDisksOperations() { + if (this.virtualHardDisksOperations == null) { + this.virtualHardDisksOperations = + new VirtualHardDisksOperationsImpl(clientObject.getVirtualHardDisksOperations(), this); + } + return virtualHardDisksOperations; + } + + /** + * Gets the resource collection API of VirtualMachineInstances. + * + * @return Resource collection API of VirtualMachineInstances. + */ + public VirtualMachineInstances virtualMachineInstances() { + if (this.virtualMachineInstances == null) { + this.virtualMachineInstances = + new VirtualMachineInstancesImpl(clientObject.getVirtualMachineInstances(), this); + } + return virtualMachineInstances; + } + + /** + * Gets the resource collection API of HybridIdentityMetadatas. * - * @return Resource collection API of ArcSettings. + * @return Resource collection API of HybridIdentityMetadatas. */ - public ArcSettings arcSettings() { - if (this.arcSettings == null) { - this.arcSettings = new ArcSettingsImpl(clientObject.getArcSettings(), this); + public HybridIdentityMetadatas hybridIdentityMetadatas() { + if (this.hybridIdentityMetadatas == null) { + this.hybridIdentityMetadatas = + new HybridIdentityMetadatasImpl(clientObject.getHybridIdentityMetadatas(), this); } - return arcSettings; + return hybridIdentityMetadatas; } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of GuestAgents. * - * @return Resource collection API of Clusters. + * @return Resource collection API of GuestAgents. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public GuestAgents guestAgents() { + if (this.guestAgents == null) { + this.guestAgents = new GuestAgentsImpl(clientObject.getGuestAgents(), this); } - return clusters; + return guestAgents; } /** - * Gets the resource collection API of Extensions. It manages Extension. + * Gets the resource collection API of GuestAgentsOperations. * - * @return Resource collection API of Extensions. + * @return Resource collection API of GuestAgentsOperations. */ - public Extensions extensions() { - if (this.extensions == null) { - this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + public GuestAgentsOperations guestAgentsOperations() { + if (this.guestAgentsOperations == null) { + this.guestAgentsOperations = new GuestAgentsOperationsImpl(clientObject.getGuestAgentsOperations(), this); } - return extensions; + return guestAgentsOperations; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of VirtualNetworksOperations. It manages VirtualNetworks. * - * @return Resource collection API of Operations. + * @return Resource collection API of VirtualNetworksOperations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public VirtualNetworksOperations virtualNetworksOperations() { + if (this.virtualNetworksOperations == null) { + this.virtualNetworksOperations = + new VirtualNetworksOperationsImpl(clientObject.getVirtualNetworksOperations(), this); } - return operations; + return virtualNetworksOperations; } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java index bb51fe0bea47c..3782afc552bfb 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java @@ -45,30 +45,72 @@ public interface AzureStackHciClient { Duration getDefaultPollInterval(); /** - * Gets the ArcSettingsClient object to access its operations. + * Gets the GalleryImagesOperationsClient object to access its operations. * - * @return the ArcSettingsClient object. + * @return the GalleryImagesOperationsClient object. */ - ArcSettingsClient getArcSettings(); + GalleryImagesOperationsClient getGalleryImagesOperations(); /** - * Gets the ClustersClient object to access its operations. + * Gets the MarketplaceGalleryImagesOperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the MarketplaceGalleryImagesOperationsClient object. */ - ClustersClient getClusters(); + MarketplaceGalleryImagesOperationsClient getMarketplaceGalleryImagesOperations(); /** - * Gets the ExtensionsClient object to access its operations. + * Gets the NetworkInterfacesOperationsClient object to access its operations. * - * @return the ExtensionsClient object. + * @return the NetworkInterfacesOperationsClient object. */ - ExtensionsClient getExtensions(); + NetworkInterfacesOperationsClient getNetworkInterfacesOperations(); /** - * Gets the OperationsClient object to access its operations. + * Gets the StorageContainersOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the StorageContainersOperationsClient object. */ - OperationsClient getOperations(); + StorageContainersOperationsClient getStorageContainersOperations(); + + /** + * Gets the VirtualHardDisksOperationsClient object to access its operations. + * + * @return the VirtualHardDisksOperationsClient object. + */ + VirtualHardDisksOperationsClient getVirtualHardDisksOperations(); + + /** + * Gets the VirtualMachineInstancesClient object to access its operations. + * + * @return the VirtualMachineInstancesClient object. + */ + VirtualMachineInstancesClient getVirtualMachineInstances(); + + /** + * Gets the HybridIdentityMetadatasClient object to access its operations. + * + * @return the HybridIdentityMetadatasClient object. + */ + HybridIdentityMetadatasClient getHybridIdentityMetadatas(); + + /** + * Gets the GuestAgentsClient object to access its operations. + * + * @return the GuestAgentsClient object. + */ + GuestAgentsClient getGuestAgents(); + + /** + * Gets the GuestAgentsOperationsClient object to access its operations. + * + * @return the GuestAgentsOperationsClient object. + */ + GuestAgentsOperationsClient getGuestAgentsOperations(); + + /** + * Gets the VirtualNetworksOperationsClient object to access its operations. + * + * @return the VirtualNetworksOperationsClient object. + */ + VirtualNetworksOperationsClient getVirtualNetworksOperations(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryImagesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryImagesOperationsClient.java new file mode 100644 index 0000000000000..8ac30aa17d8ce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryImagesOperationsClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest; + +/** An instance of this class provides access to all the operations defined in GalleryImagesOperationsClient. */ +public interface GalleryImagesOperationsClient { + /** + * Gets a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @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 gallery image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryImageName, Context context); + + /** + * Gets a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @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 gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImagesInner getByResourceGroup(String resourceGroupName, String galleryImageName); + + /** + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages); + + /** + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context); + + /** + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImagesInner createOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages); + + /** + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImagesInner createOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context); + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryImageName); + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryImageName, Context context); + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @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 galleryImageName); + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryImageName, Context context); + + /** + * The operation to update a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryImagesInner> beginUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages); + + /** + * The operation to update a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryImagesInner> beginUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context); + + /** + * The operation to update a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. + * @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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImagesInner update( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages); + + /** + * The operation to update a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. + * @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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImagesInner update( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context); + + /** + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsClient.java new file mode 100644 index 0000000000000..22aeedc79f55d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; + +/** An instance of this class provides access to all the operations defined in GuestAgentsClient. */ +public interface GuestAgentsClient { + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuestAgentInner> beginCreate(String resourceUri); + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuestAgentInner> beginCreate( + String resourceUri, GuestAgentInner body, Context context); + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner create(String resourceUri); + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner create(String resourceUri, GuestAgentInner body, Context context); + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner get(String resourceUri); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri, Context context); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsOperationsClient.java new file mode 100644 index 0000000000000..6bda752073d44 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsOperationsClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; + +/** An instance of this class provides access to all the operations defined in GuestAgentsOperationsClient. */ +public interface GuestAgentsOperationsClient { + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/HybridIdentityMetadatasClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/HybridIdentityMetadatasClient.java new file mode 100644 index 0000000000000..8082f894a4d09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/HybridIdentityMetadatasClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.models.HybridIdentityMetadataInner; + +/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ +public interface HybridIdentityMetadatasClient { + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HybridIdentityMetadataInner get(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/MarketplaceGalleryImagesOperationsClient.java similarity index 52% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/MarketplaceGalleryImagesOperationsClient.java index d9662370c2a31..b082967a0ae2c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/MarketplaceGalleryImagesOperationsClient.java @@ -11,308 +11,290 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest; -/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ -public interface ExtensionsClient { +/** + * An instance of this class provides access to all the operations defined in MarketplaceGalleryImagesOperationsClient. + */ +public interface MarketplaceGalleryImagesOperationsClient { /** - * List all Extensions under ArcSetting resource. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + * @return a marketplace gallery image along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String marketplaceGalleryImageName, Context context); + + /** + * Gets a marketplace gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 marketplace gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceGalleryImagesInner getByResourceGroup(String resourceGroupName, String marketplaceGalleryImageName); /** - * List all Extensions under ArcSetting resource. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages); + + /** + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context); /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 particular Arc Extension of HCI Cluster. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + MarketplaceGalleryImagesInner createOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages); /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 particular Arc Extension of HCI Cluster along with {@link Response}. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + MarketplaceGalleryImagesInner createOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context); /** - * Create Extension for HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExtensionInner> beginCreate( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension); + SyncPoller, Void> beginDelete(String resourceGroupName, String marketplaceGalleryImageName); /** - * Create Extension for HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExtensionInner> beginCreate( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context); + SyncPoller, Void> beginDelete( + String resourceGroupName, String marketplaceGalleryImageName, Context context); /** - * Create Extension for HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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 details of a particular extension in HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner create( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension); + void delete(String resourceGroupName, String marketplaceGalleryImageName); /** - * Create Extension for HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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 details of a particular extension in HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner create( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context); + void delete(String resourceGroupName, String marketplaceGalleryImageName, Context context); /** - * Update Extension for HCI cluster. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExtensionInner> beginUpdate( + SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension); + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages); /** - * Update Extension for HCI cluster. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExtensionInner> beginUpdate( + SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context); /** - * Update Extension for HCI cluster. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @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 details of a particular extension in HCI Cluster. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner update( + MarketplaceGalleryImagesInner update( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension); + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages); /** - * Update Extension for HCI cluster. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @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 details of a particular extension in HCI Cluster. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner update( + MarketplaceGalleryImagesInner update( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @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 paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @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 paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java similarity index 55% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java index e7dd0a66b8486..e090bed11e54e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java @@ -11,289 +11,280 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest; -/** An instance of this class provides access to all the operations defined in ArcSettingsClient. */ -public interface ArcSettingsClient { +/** An instance of this class provides access to all the operations defined in NetworkInterfacesOperationsClient. */ +public interface NetworkInterfacesOperationsClient { /** - * Get ArcSetting resources of HCI Cluster. + * Gets a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param networkInterfaceName Name of the network interface. + * @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + * @return a network interface along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCluster(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, Context context); /** - * Get ArcSetting resources of HCI Cluster. + * Gets a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. + * @param networkInterfaceName Name of the network interface. * @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + * @return a network interface. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfacesInner getByResourceGroup(String resourceGroupName, String networkInterfaceName); /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. * @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 arcSetting resource details of HCI Cluster. + * @return the {@link SyncPoller} for polling of the network interface resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces); /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. * @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 arcSetting resource details of HCI Cluster along with {@link Response}. + * @return the {@link SyncPoller} for polling of the network interface resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + Context context); /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. * @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 arcSetting details. + * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); + NetworkInterfacesInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces); /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. * @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 arcSetting details along with {@link Response}. + * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( + NetworkInterfacesInner createOrUpdate( String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, Context context); /** - * Update ArcSettings for HCI cluster. + * The operation to delete a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param networkInterfaceName Name of the network interface. * @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 arcSetting details. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName); /** - * Update ArcSettings for HCI cluster. + * The operation to delete a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param networkInterfaceName Name of the network interface. * @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 arcSetting details along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, Context context); /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to delete a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkInterfaceName); /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to delete a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkInterfaceName, Context context); /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces); /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginUpdate( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context); /** - * Generate password for arc settings. + * The operation to update a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + NetworkInterfacesInner update( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces); /** - * Generate password for arc settings. + * The operation to update a network interface. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + NetworkInterfacesInner update( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context); /** - * Create Aad identity for arc settings. + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of arcIdentity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Create Aad identity for arc settings. + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of arcIdentity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create Aad identity for arc settings. + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 arcIdentity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Create Aad identity for arc settings. + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @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 arcIdentity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcIdentityResponseInner createIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java deleted file mode 100644 index 0b8e907abe681..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +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.azurestackhci.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @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 REST API operations supported by an Azure Resource Provider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StorageContainersOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StorageContainersOperationsClient.java new file mode 100644 index 0000000000000..3f85568128571 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StorageContainersOperationsClient.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest; + +/** An instance of this class provides access to all the operations defined in StorageContainersOperationsClient. */ +public interface StorageContainersOperationsClient { + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String storageContainerName, Context context); + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainersInner getByResourceGroup(String resourceGroupName, String storageContainerName); + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageContainersInner> beginCreateOrUpdate( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers); + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageContainersInner> beginCreateOrUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context); + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainersInner createOrUpdate( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers); + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainersInner createOrUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String storageContainerName); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageContainerName, Context context); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storageContainerName); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String storageContainerName, Context context); + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageContainersInner> beginUpdate( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers); + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageContainersInner> beginUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context); + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainersInner update( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers); + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainersInner update( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context); + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualHardDisksOperationsClient.java similarity index 55% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualHardDisksOperationsClient.java index 625ccd127e93b..3cdddaffc2def 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualHardDisksOperationsClient.java @@ -11,166 +11,123 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest; -/** An instance of this class provides access to all the operations defined in ClustersClient. */ -public interface ClustersClient { +/** An instance of this class provides access to all the operations defined in VirtualHardDisksOperationsClient. */ +public interface VirtualHardDisksOperationsClient { /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all HCI clusters in a resource group. + * Gets a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 hCI cluster. + * @return a virtual hard disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHardDiskName, Context context); /** - * Get HCI cluster. + * Gets a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 hCI cluster along with {@link Response}. + * @return a virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + VirtualHardDisksInner getByResourceGroup(String resourceGroupName, String virtualHardDiskName); /** - * Create an HCI cluster. + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. * @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 cluster details. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks); /** - * Create an HCI cluster. + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. * @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 cluster details along with {@link Response}. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context); /** - * Update an HCI cluster. + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. * @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 cluster details. + * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); + VirtualHardDisksInner createOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks); /** - * Update an HCI cluster. + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. * @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 cluster details along with {@link Response}. + * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); + VirtualHardDisksInner createOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHardDiskName); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @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. @@ -178,152 +135,150 @@ Response updateWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHardDiskName, Context context); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 clusterName); + void delete(String resourceGroupName, String virtualHardDiskName); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, Context context); + void delete(String resourceGroupName, String virtualHardDiskName, Context context); /** - * Upload certificate. + * The operation to update a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + SyncPoller, VirtualHardDisksInner> beginUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks); /** - * Upload certificate. + * The operation to update a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUploadCertificate( + SyncPoller, VirtualHardDisksInner> beginUpdate( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, Context context); /** - * Upload certificate. + * The operation to update a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. * @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 virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void uploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + VirtualHardDisksInner update( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks); /** - * Upload certificate. + * The operation to update a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. * @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 virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void uploadCertificate( + VirtualHardDisksInner update( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, Context context); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualMachineInstancesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualMachineInstancesClient.java new file mode 100644 index 0000000000000..76dba84e1664a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualMachineInstancesClient.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; + +/** An instance of this class provides access to all the operations defined in VirtualMachineInstancesClient. */ +public interface VirtualMachineInstancesClient { + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner get(String resourceUri); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri, Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginStart(String resourceUri); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginStart( + String resourceUri, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner start(String resourceUri); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner start(String resourceUri, Context context); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginStop(String resourceUri); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginStop( + String resourceUri, Context context); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner stop(String resourceUri); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner stop(String resourceUri, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginRestart(String resourceUri); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginRestart( + String resourceUri, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner restart(String resourceUri); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner restart(String resourceUri, Context context); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualNetworksOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualNetworksOperationsClient.java new file mode 100644 index 0000000000000..76e5722b3f404 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualNetworksOperationsClient.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksUpdateRequest; + +/** An instance of this class provides access to all the operations defined in VirtualNetworksOperationsClient. */ +public interface VirtualNetworksOperationsClient { + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtual network resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, Context context); + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworksInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks); + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context); + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworksInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks); + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworksInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, Context context); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtualNetworkName); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * The operation to update a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworksInner> beginUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks); + + /** + * The operation to update a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworksInner> beginUpdate( + String resourceGroupName, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, + Context context); + + /** + * The operation to update a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. + * @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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworksInner update( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks); + + /** + * The operation to update a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. + * @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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworksInner update( + String resourceGroupName, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, + Context context); + + /** + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java deleted file mode 100644 index 909acd05b51ed..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java +++ /dev/null @@ -1,130 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ArcIdentity details. */ -@Immutable -public final class ArcIdentityResponseInner { - /* - * ArcIdentity properties. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private ArcIdentityResponseProperties innerProperties; - - /** - * Get the innerProperties property: ArcIdentity properties. - * - * @return the innerProperties value. - */ - private ArcIdentityResponseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the arcApplicationClientId property: The arcApplicationClientId property. - * - * @return the arcApplicationClientId value. - */ - public String arcApplicationClientId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); - } - - /** - * Set the arcApplicationClientId property: The arcApplicationClientId property. - * - * @param arcApplicationClientId the arcApplicationClientId value to set. - * @return the ArcIdentityResponseInner object itself. - */ - public ArcIdentityResponseInner withArcApplicationClientId(String arcApplicationClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcIdentityResponseProperties(); - } - this.innerProperties().withArcApplicationClientId(arcApplicationClientId); - return this; - } - - /** - * Get the arcApplicationTenantId property: The arcApplicationTenantId property. - * - * @return the arcApplicationTenantId value. - */ - public String arcApplicationTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); - } - - /** - * Set the arcApplicationTenantId property: The arcApplicationTenantId property. - * - * @param arcApplicationTenantId the arcApplicationTenantId value to set. - * @return the ArcIdentityResponseInner object itself. - */ - public ArcIdentityResponseInner withArcApplicationTenantId(String arcApplicationTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcIdentityResponseProperties(); - } - this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); - return this; - } - - /** - * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. - * - * @return the arcServicePrincipalObjectId value. - */ - public String arcServicePrincipalObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); - } - - /** - * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. - * - * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. - * @return the ArcIdentityResponseInner object itself. - */ - public ArcIdentityResponseInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcIdentityResponseProperties(); - } - this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); - return this; - } - - /** - * Get the arcApplicationObjectId property: The arcApplicationObjectId property. - * - * @return the arcApplicationObjectId value. - */ - public String arcApplicationObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); - } - - /** - * Set the arcApplicationObjectId property: The arcApplicationObjectId property. - * - * @param arcApplicationObjectId the arcApplicationObjectId value to set. - * @return the ArcIdentityResponseInner object itself. - */ - public ArcIdentityResponseInner withArcApplicationObjectId(String arcApplicationObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcIdentityResponseProperties(); - } - this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java deleted file mode 100644 index 5b20f4848fb72..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java +++ /dev/null @@ -1,124 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ArcIdentityResponseProperties model. */ -@Fluent -public final class ArcIdentityResponseProperties { - /* - * The arcApplicationClientId property. - */ - @JsonProperty(value = "arcApplicationClientId") - private String arcApplicationClientId; - - /* - * The arcApplicationTenantId property. - */ - @JsonProperty(value = "arcApplicationTenantId") - private String arcApplicationTenantId; - - /* - * The arcServicePrincipalObjectId property. - */ - @JsonProperty(value = "arcServicePrincipalObjectId") - private String arcServicePrincipalObjectId; - - /* - * The arcApplicationObjectId property. - */ - @JsonProperty(value = "arcApplicationObjectId") - private String arcApplicationObjectId; - - /** - * Get the arcApplicationClientId property: The arcApplicationClientId property. - * - * @return the arcApplicationClientId value. - */ - public String arcApplicationClientId() { - return this.arcApplicationClientId; - } - - /** - * Set the arcApplicationClientId property: The arcApplicationClientId property. - * - * @param arcApplicationClientId the arcApplicationClientId value to set. - * @return the ArcIdentityResponseProperties object itself. - */ - public ArcIdentityResponseProperties withArcApplicationClientId(String arcApplicationClientId) { - this.arcApplicationClientId = arcApplicationClientId; - return this; - } - - /** - * Get the arcApplicationTenantId property: The arcApplicationTenantId property. - * - * @return the arcApplicationTenantId value. - */ - public String arcApplicationTenantId() { - return this.arcApplicationTenantId; - } - - /** - * Set the arcApplicationTenantId property: The arcApplicationTenantId property. - * - * @param arcApplicationTenantId the arcApplicationTenantId value to set. - * @return the ArcIdentityResponseProperties object itself. - */ - public ArcIdentityResponseProperties withArcApplicationTenantId(String arcApplicationTenantId) { - this.arcApplicationTenantId = arcApplicationTenantId; - return this; - } - - /** - * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. - * - * @return the arcServicePrincipalObjectId value. - */ - public String arcServicePrincipalObjectId() { - return this.arcServicePrincipalObjectId; - } - - /** - * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. - * - * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. - * @return the ArcIdentityResponseProperties object itself. - */ - public ArcIdentityResponseProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { - this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; - return this; - } - - /** - * Get the arcApplicationObjectId property: The arcApplicationObjectId property. - * - * @return the arcApplicationObjectId value. - */ - public String arcApplicationObjectId() { - return this.arcApplicationObjectId; - } - - /** - * Set the arcApplicationObjectId property: The arcApplicationObjectId property. - * - * @param arcApplicationObjectId the arcApplicationObjectId value to set. - * @return the ArcIdentityResponseProperties object itself. - */ - public ArcIdentityResponseProperties withArcApplicationObjectId(String arcApplicationObjectId) { - this.arcApplicationObjectId = arcApplicationObjectId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java deleted file mode 100644 index cfdbb16c5d221..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java +++ /dev/null @@ -1,226 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; -import com.azure.resourcemanager.azurestackhci.models.PerNodeState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ArcSetting details. */ -@Fluent -public final class ArcSettingInner extends ProxyResource { - /* - * System data of ArcSetting resource - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * ArcSetting properties. - */ - @JsonProperty(value = "properties") - private ArcSettingProperties innerProperties; - - /** - * Get the systemData property: System data of ArcSetting resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: ArcSetting properties. - * - * @return the innerProperties value. - */ - private ArcSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute - * Machine resources. - * - * @return the arcInstanceResourceGroup value. - */ - public String arcInstanceResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().arcInstanceResourceGroup(); - } - - /** - * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute - * Machine resources. - * - * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withArcInstanceResourceGroup(String arcInstanceResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withArcInstanceResourceGroup(arcInstanceResourceGroup); - return this; - } - - /** - * Get the arcApplicationClientId property: App id of arc AAD identity. - * - * @return the arcApplicationClientId value. - */ - public String arcApplicationClientId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); - } - - /** - * Set the arcApplicationClientId property: App id of arc AAD identity. - * - * @param arcApplicationClientId the arcApplicationClientId value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withArcApplicationClientId(String arcApplicationClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withArcApplicationClientId(arcApplicationClientId); - return this; - } - - /** - * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. - * - * @return the arcApplicationTenantId value. - */ - public String arcApplicationTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); - } - - /** - * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. - * - * @param arcApplicationTenantId the arcApplicationTenantId value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withArcApplicationTenantId(String arcApplicationTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); - return this; - } - - /** - * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. - * - * @return the arcServicePrincipalObjectId value. - */ - public String arcServicePrincipalObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); - } - - /** - * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. - * - * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); - return this; - } - - /** - * Get the arcApplicationObjectId property: Object id of arc AAD identity. - * - * @return the arcApplicationObjectId value. - */ - public String arcApplicationObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); - } - - /** - * Set the arcApplicationObjectId property: Object id of arc AAD identity. - * - * @param arcApplicationObjectId the arcApplicationObjectId value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withArcApplicationObjectId(String arcApplicationObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); - return this; - } - - /** - * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - public ArcSettingAggregateState aggregateState() { - return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); - } - - /** - * Get the perNodeDetails property: State of Arc agent in each of the nodes. - * - * @return the perNodeDetails value. - */ - public List perNodeDetails() { - return this.innerProperties() == null ? null : this.innerProperties().perNodeDetails(); - } - - /** - * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @return the connectivityProperties value. - */ - public Object connectivityProperties() { - return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); - } - - /** - * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @param connectivityProperties the connectivityProperties value to set. - * @return the ArcSettingInner object itself. - */ - public ArcSettingInner withConnectivityProperties(Object connectivityProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingProperties(); - } - this.innerProperties().withConnectivityProperties(connectivityProperties); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java deleted file mode 100644 index e628ec8d6f034..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java +++ /dev/null @@ -1,231 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; -import com.azure.resourcemanager.azurestackhci.models.PerNodeState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ArcSetting properties. */ -@Fluent -public final class ArcSettingProperties { - /* - * Provisioning state of the ArcSetting proxy resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine - * resources. - */ - @JsonProperty(value = "arcInstanceResourceGroup") - private String arcInstanceResourceGroup; - - /* - * App id of arc AAD identity. - */ - @JsonProperty(value = "arcApplicationClientId") - private String arcApplicationClientId; - - /* - * Tenant id of arc AAD identity. - */ - @JsonProperty(value = "arcApplicationTenantId") - private String arcApplicationTenantId; - - /* - * Object id of arc AAD service principal. - */ - @JsonProperty(value = "arcServicePrincipalObjectId") - private String arcServicePrincipalObjectId; - - /* - * Object id of arc AAD identity. - */ - @JsonProperty(value = "arcApplicationObjectId") - private String arcApplicationObjectId; - - /* - * Aggregate state of Arc agent across the nodes in this HCI cluster. - */ - @JsonProperty(value = "aggregateState", access = JsonProperty.Access.WRITE_ONLY) - private ArcSettingAggregateState aggregateState; - - /* - * State of Arc agent in each of the nodes. - */ - @JsonProperty(value = "perNodeDetails", access = JsonProperty.Access.WRITE_ONLY) - private List perNodeDetails; - - /* - * contains connectivity related configuration for ARC resources - */ - @JsonProperty(value = "connectivityProperties") - private Object connectivityProperties; - - /** - * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute - * Machine resources. - * - * @return the arcInstanceResourceGroup value. - */ - public String arcInstanceResourceGroup() { - return this.arcInstanceResourceGroup; - } - - /** - * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute - * Machine resources. - * - * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withArcInstanceResourceGroup(String arcInstanceResourceGroup) { - this.arcInstanceResourceGroup = arcInstanceResourceGroup; - return this; - } - - /** - * Get the arcApplicationClientId property: App id of arc AAD identity. - * - * @return the arcApplicationClientId value. - */ - public String arcApplicationClientId() { - return this.arcApplicationClientId; - } - - /** - * Set the arcApplicationClientId property: App id of arc AAD identity. - * - * @param arcApplicationClientId the arcApplicationClientId value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withArcApplicationClientId(String arcApplicationClientId) { - this.arcApplicationClientId = arcApplicationClientId; - return this; - } - - /** - * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. - * - * @return the arcApplicationTenantId value. - */ - public String arcApplicationTenantId() { - return this.arcApplicationTenantId; - } - - /** - * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. - * - * @param arcApplicationTenantId the arcApplicationTenantId value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withArcApplicationTenantId(String arcApplicationTenantId) { - this.arcApplicationTenantId = arcApplicationTenantId; - return this; - } - - /** - * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. - * - * @return the arcServicePrincipalObjectId value. - */ - public String arcServicePrincipalObjectId() { - return this.arcServicePrincipalObjectId; - } - - /** - * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. - * - * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { - this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; - return this; - } - - /** - * Get the arcApplicationObjectId property: Object id of arc AAD identity. - * - * @return the arcApplicationObjectId value. - */ - public String arcApplicationObjectId() { - return this.arcApplicationObjectId; - } - - /** - * Set the arcApplicationObjectId property: Object id of arc AAD identity. - * - * @param arcApplicationObjectId the arcApplicationObjectId value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withArcApplicationObjectId(String arcApplicationObjectId) { - this.arcApplicationObjectId = arcApplicationObjectId; - return this; - } - - /** - * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - public ArcSettingAggregateState aggregateState() { - return this.aggregateState; - } - - /** - * Get the perNodeDetails property: State of Arc agent in each of the nodes. - * - * @return the perNodeDetails value. - */ - public List perNodeDetails() { - return this.perNodeDetails; - } - - /** - * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @return the connectivityProperties value. - */ - public Object connectivityProperties() { - return this.connectivityProperties; - } - - /** - * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @param connectivityProperties the connectivityProperties value to set. - * @return the ArcSettingProperties object itself. - */ - public ArcSettingProperties withConnectivityProperties(Object connectivityProperties) { - this.connectivityProperties = connectivityProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (perNodeDetails() != null) { - perNodeDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java deleted file mode 100644 index ea82478352316..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ArcSettings properties. */ -@Fluent -public final class ArcSettingsPatchProperties { - /* - * contains connectivity related configuration for ARC resources - */ - @JsonProperty(value = "connectivityProperties") - private Object connectivityProperties; - - /** - * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @return the connectivityProperties value. - */ - public Object connectivityProperties() { - return this.connectivityProperties; - } - - /** - * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @param connectivityProperties the connectivityProperties value to set. - * @return the ArcSettingsPatchProperties object itself. - */ - public ArcSettingsPatchProperties withConnectivityProperties(Object connectivityProperties) { - this.connectivityProperties = connectivityProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java deleted file mode 100644 index be934a9d5d353..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java +++ /dev/null @@ -1,130 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Cluster Identity details. */ -@Immutable -public final class ClusterIdentityResponseInner { - /* - * Cluster identity properties. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private ClusterIdentityResponseProperties innerProperties; - - /** - * Get the innerProperties property: Cluster identity properties. - * - * @return the innerProperties value. - */ - private ClusterIdentityResponseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the aadClientId property: The aadClientId property. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); - } - - /** - * Set the aadClientId property: The aadClientId property. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterIdentityResponseInner object itself. - */ - public ClusterIdentityResponseInner withAadClientId(String aadClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterIdentityResponseProperties(); - } - this.innerProperties().withAadClientId(aadClientId); - return this; - } - - /** - * Get the aadTenantId property: The aadTenantId property. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); - } - - /** - * Set the aadTenantId property: The aadTenantId property. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterIdentityResponseInner object itself. - */ - public ClusterIdentityResponseInner withAadTenantId(String aadTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterIdentityResponseProperties(); - } - this.innerProperties().withAadTenantId(aadTenantId); - return this; - } - - /** - * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. - * - * @return the aadServicePrincipalObjectId value. - */ - public String aadServicePrincipalObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); - } - - /** - * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. - * - * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. - * @return the ClusterIdentityResponseInner object itself. - */ - public ClusterIdentityResponseInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterIdentityResponseProperties(); - } - this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); - return this; - } - - /** - * Get the aadApplicationObjectId property: The aadApplicationObjectId property. - * - * @return the aadApplicationObjectId value. - */ - public String aadApplicationObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); - } - - /** - * Set the aadApplicationObjectId property: The aadApplicationObjectId property. - * - * @param aadApplicationObjectId the aadApplicationObjectId value to set. - * @return the ClusterIdentityResponseInner object itself. - */ - public ClusterIdentityResponseInner withAadApplicationObjectId(String aadApplicationObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterIdentityResponseProperties(); - } - this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java deleted file mode 100644 index 745b333748ae2..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java +++ /dev/null @@ -1,124 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ClusterIdentityResponseProperties model. */ -@Fluent -public final class ClusterIdentityResponseProperties { - /* - * The aadClientId property. - */ - @JsonProperty(value = "aadClientId") - private String aadClientId; - - /* - * The aadTenantId property. - */ - @JsonProperty(value = "aadTenantId") - private String aadTenantId; - - /* - * The aadServicePrincipalObjectId property. - */ - @JsonProperty(value = "aadServicePrincipalObjectId") - private String aadServicePrincipalObjectId; - - /* - * The aadApplicationObjectId property. - */ - @JsonProperty(value = "aadApplicationObjectId") - private String aadApplicationObjectId; - - /** - * Get the aadClientId property: The aadClientId property. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.aadClientId; - } - - /** - * Set the aadClientId property: The aadClientId property. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterIdentityResponseProperties object itself. - */ - public ClusterIdentityResponseProperties withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; - return this; - } - - /** - * Get the aadTenantId property: The aadTenantId property. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: The aadTenantId property. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterIdentityResponseProperties object itself. - */ - public ClusterIdentityResponseProperties withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. - * - * @return the aadServicePrincipalObjectId value. - */ - public String aadServicePrincipalObjectId() { - return this.aadServicePrincipalObjectId; - } - - /** - * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. - * - * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. - * @return the ClusterIdentityResponseProperties object itself. - */ - public ClusterIdentityResponseProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { - this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; - return this; - } - - /** - * Get the aadApplicationObjectId property: The aadApplicationObjectId property. - * - * @return the aadApplicationObjectId value. - */ - public String aadApplicationObjectId() { - return this.aadApplicationObjectId; - } - - /** - * Set the aadApplicationObjectId property: The aadApplicationObjectId property. - * - * @param aadApplicationObjectId the aadApplicationObjectId value to set. - * @return the ClusterIdentityResponseProperties object itself. - */ - public ClusterIdentityResponseProperties withAadApplicationObjectId(String aadApplicationObjectId) { - this.aadApplicationObjectId = aadApplicationObjectId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java deleted file mode 100644 index 90830dc5dd720..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ /dev/null @@ -1,303 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Cluster details. */ -@Fluent -public final class ClusterInner extends Resource { - /* - * System data of Cluster resource - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Cluster properties. - */ - @JsonProperty(value = "properties") - private ClusterProperties innerProperties; - - /** - * Get the systemData property: System data of Cluster resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Cluster properties. - * - * @return the innerProperties value. - */ - private ClusterProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Status of the cluster agent. - * - * @return the status value. - */ - public Status status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the cloudId property: Unique, immutable resource id. - * - * @return the cloudId value. - */ - public String cloudId() { - return this.innerProperties() == null ? null : this.innerProperties().cloudId(); - } - - /** - * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @return the cloudManagementEndpoint value. - */ - public String cloudManagementEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); - } - - /** - * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withCloudManagementEndpoint(String cloudManagementEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); - return this; - } - - /** - * Get the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); - } - - /** - * Set the aadClientId property: App id of cluster AAD identity. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadClientId(String aadClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withAadClientId(aadClientId); - return this; - } - - /** - * Get the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); - } - - /** - * Set the aadTenantId property: Tenant id of cluster AAD identity. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadTenantId(String aadTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withAadTenantId(aadTenantId); - return this; - } - - /** - * Get the aadApplicationObjectId property: Object id of cluster AAD identity. - * - * @return the aadApplicationObjectId value. - */ - public String aadApplicationObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); - } - - /** - * Set the aadApplicationObjectId property: Object id of cluster AAD identity. - * - * @param aadApplicationObjectId the aadApplicationObjectId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadApplicationObjectId(String aadApplicationObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); - return this; - } - - /** - * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. - * - * @return the aadServicePrincipalObjectId value. - */ - public String aadServicePrincipalObjectId() { - return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); - } - - /** - * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. - * - * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); - return this; - } - - /** - * Get the desiredProperties property: Desired properties of the cluster. - * - * @return the desiredProperties value. - */ - public ClusterDesiredProperties desiredProperties() { - return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); - } - - /** - * Set the desiredProperties property: Desired properties of the cluster. - * - * @param desiredProperties the desiredProperties value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withDesiredProperties(ClusterDesiredProperties desiredProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withDesiredProperties(desiredProperties); - return this; - } - - /** - * Get the reportedProperties property: Properties reported by cluster agent. - * - * @return the reportedProperties value. - */ - public ClusterReportedProperties reportedProperties() { - return this.innerProperties() == null ? null : this.innerProperties().reportedProperties(); - } - - /** - * Get the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - public Float trialDaysRemaining() { - return this.innerProperties() == null ? null : this.innerProperties().trialDaysRemaining(); - } - - /** - * Get the billingModel property: Type of billing applied to the resource. - * - * @return the billingModel value. - */ - public String billingModel() { - return this.innerProperties() == null ? null : this.innerProperties().billingModel(); - } - - /** - * Get the registrationTimestamp property: First cluster sync timestamp. - * - * @return the registrationTimestamp value. - */ - public OffsetDateTime registrationTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().registrationTimestamp(); - } - - /** - * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - public OffsetDateTime lastSyncTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().lastSyncTimestamp(); - } - - /** - * Get the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - public OffsetDateTime lastBillingTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().lastBillingTimestamp(); - } - - /** - * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. - * - * @return the serviceEndpoint value. - */ - public String serviceEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java deleted file mode 100644 index 170d36a4d2b3a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java +++ /dev/null @@ -1,128 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Cluster properties. */ -@Fluent -public final class ClusterPatchProperties { - /* - * Endpoint configured for management from the Azure portal - */ - @JsonProperty(value = "cloudManagementEndpoint") - private String cloudManagementEndpoint; - - /* - * App id of cluster AAD identity. - */ - @JsonProperty(value = "aadClientId") - private String aadClientId; - - /* - * Tenant id of cluster AAD identity. - */ - @JsonProperty(value = "aadTenantId") - private String aadTenantId; - - /* - * Desired properties of the cluster. - */ - @JsonProperty(value = "desiredProperties") - private ClusterDesiredProperties desiredProperties; - - /** - * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @return the cloudManagementEndpoint value. - */ - public String cloudManagementEndpoint() { - return this.cloudManagementEndpoint; - } - - /** - * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. - * @return the ClusterPatchProperties object itself. - */ - public ClusterPatchProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { - this.cloudManagementEndpoint = cloudManagementEndpoint; - return this; - } - - /** - * Get the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.aadClientId; - } - - /** - * Set the aadClientId property: App id of cluster AAD identity. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterPatchProperties object itself. - */ - public ClusterPatchProperties withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; - return this; - } - - /** - * Get the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: Tenant id of cluster AAD identity. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterPatchProperties object itself. - */ - public ClusterPatchProperties withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the desiredProperties property: Desired properties of the cluster. - * - * @return the desiredProperties value. - */ - public ClusterDesiredProperties desiredProperties() { - return this.desiredProperties; - } - - /** - * Set the desiredProperties property: Desired properties of the cluster. - * - * @param desiredProperties the desiredProperties value to set. - * @return the ClusterPatchProperties object itself. - */ - public ClusterPatchProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { - this.desiredProperties = desiredProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (desiredProperties() != null) { - desiredProperties().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java deleted file mode 100644 index cb7310c87094d..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java +++ /dev/null @@ -1,337 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Cluster properties. */ -@Fluent -public final class ClusterProperties { - /* - * Provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Status of the cluster agent. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; - - /* - * Unique, immutable resource id. - */ - @JsonProperty(value = "cloudId", access = JsonProperty.Access.WRITE_ONLY) - private String cloudId; - - /* - * Endpoint configured for management from the Azure portal. - */ - @JsonProperty(value = "cloudManagementEndpoint") - private String cloudManagementEndpoint; - - /* - * App id of cluster AAD identity. - */ - @JsonProperty(value = "aadClientId") - private String aadClientId; - - /* - * Tenant id of cluster AAD identity. - */ - @JsonProperty(value = "aadTenantId") - private String aadTenantId; - - /* - * Object id of cluster AAD identity. - */ - @JsonProperty(value = "aadApplicationObjectId") - private String aadApplicationObjectId; - - /* - * Id of cluster identity service principal. - */ - @JsonProperty(value = "aadServicePrincipalObjectId") - private String aadServicePrincipalObjectId; - - /* - * Desired properties of the cluster. - */ - @JsonProperty(value = "desiredProperties") - private ClusterDesiredProperties desiredProperties; - - /* - * Properties reported by cluster agent. - */ - @JsonProperty(value = "reportedProperties", access = JsonProperty.Access.WRITE_ONLY) - private ClusterReportedProperties reportedProperties; - - /* - * Number of days remaining in the trial period. - */ - @JsonProperty(value = "trialDaysRemaining", access = JsonProperty.Access.WRITE_ONLY) - private Float trialDaysRemaining; - - /* - * Type of billing applied to the resource. - */ - @JsonProperty(value = "billingModel", access = JsonProperty.Access.WRITE_ONLY) - private String billingModel; - - /* - * First cluster sync timestamp. - */ - @JsonProperty(value = "registrationTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime registrationTimestamp; - - /* - * Most recent cluster sync timestamp. - */ - @JsonProperty(value = "lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastSyncTimestamp; - - /* - * Most recent billing meter timestamp. - */ - @JsonProperty(value = "lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastBillingTimestamp; - - /* - * Region specific DataPath Endpoint of the cluster. - */ - @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String serviceEndpoint; - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Status of the cluster agent. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Get the cloudId property: Unique, immutable resource id. - * - * @return the cloudId value. - */ - public String cloudId() { - return this.cloudId; - } - - /** - * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @return the cloudManagementEndpoint value. - */ - public String cloudManagementEndpoint() { - return this.cloudManagementEndpoint; - } - - /** - * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { - this.cloudManagementEndpoint = cloudManagementEndpoint; - return this; - } - - /** - * Get the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.aadClientId; - } - - /** - * Set the aadClientId property: App id of cluster AAD identity. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; - return this; - } - - /** - * Get the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: Tenant id of cluster AAD identity. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the aadApplicationObjectId property: Object id of cluster AAD identity. - * - * @return the aadApplicationObjectId value. - */ - public String aadApplicationObjectId() { - return this.aadApplicationObjectId; - } - - /** - * Set the aadApplicationObjectId property: Object id of cluster AAD identity. - * - * @param aadApplicationObjectId the aadApplicationObjectId value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withAadApplicationObjectId(String aadApplicationObjectId) { - this.aadApplicationObjectId = aadApplicationObjectId; - return this; - } - - /** - * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. - * - * @return the aadServicePrincipalObjectId value. - */ - public String aadServicePrincipalObjectId() { - return this.aadServicePrincipalObjectId; - } - - /** - * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. - * - * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { - this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; - return this; - } - - /** - * Get the desiredProperties property: Desired properties of the cluster. - * - * @return the desiredProperties value. - */ - public ClusterDesiredProperties desiredProperties() { - return this.desiredProperties; - } - - /** - * Set the desiredProperties property: Desired properties of the cluster. - * - * @param desiredProperties the desiredProperties value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { - this.desiredProperties = desiredProperties; - return this; - } - - /** - * Get the reportedProperties property: Properties reported by cluster agent. - * - * @return the reportedProperties value. - */ - public ClusterReportedProperties reportedProperties() { - return this.reportedProperties; - } - - /** - * Get the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - public Float trialDaysRemaining() { - return this.trialDaysRemaining; - } - - /** - * Get the billingModel property: Type of billing applied to the resource. - * - * @return the billingModel value. - */ - public String billingModel() { - return this.billingModel; - } - - /** - * Get the registrationTimestamp property: First cluster sync timestamp. - * - * @return the registrationTimestamp value. - */ - public OffsetDateTime registrationTimestamp() { - return this.registrationTimestamp; - } - - /** - * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - public OffsetDateTime lastSyncTimestamp() { - return this.lastSyncTimestamp; - } - - /** - * Get the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - public OffsetDateTime lastBillingTimestamp() { - return this.lastBillingTimestamp; - } - - /** - * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. - * - * @return the serviceEndpoint value. - */ - public String serviceEndpoint() { - return this.serviceEndpoint; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (desiredProperties() != null) { - desiredProperties().validate(); - } - if (reportedProperties() != null) { - reportedProperties().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.java new file mode 100644 index 0000000000000..cf9c6b63550bb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesSubnetsPropertiesItemsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTablePropertiesFormat route Table resource. */ +@Fluent +public final class Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties { + /* + * Routes - Collection of routes contained within a route table. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Creates an instance of + * Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties class. + */ + public Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties() { + } + + /** + * Get the routes property: Routes - Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Routes - Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + * object itself. + */ + public Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java deleted file mode 100644 index 915af50280efa..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java +++ /dev/null @@ -1,253 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; -import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Details of a particular extension in HCI Cluster. */ -@Fluent -public final class ExtensionInner extends ProxyResource { - /* - * System data of Extension resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Describes Machine Extension Properties. - */ - @JsonProperty(value = "properties") - private ExtensionProperties innerProperties; - - /** - * Get the systemData property: System data of Extension resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Describes Machine Extension Properties. - * - * @return the innerProperties value. - */ - private ExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Provisioning state of the Extension proxy resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - public ExtensionAggregateState aggregateState() { - return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); - } - - /** - * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. - * - * @return the perNodeExtensionDetails value. - */ - public List perNodeExtensionDetails() { - return this.innerProperties() == null ? null : this.innerProperties().perNodeExtensionDetails(); - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: Protected settings (may contain secrets). - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: Protected settings (may contain secrets). - * - * @param protectedSettings the protectedSettings value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java deleted file mode 100644 index 52eea9ddbd4ae..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java +++ /dev/null @@ -1,213 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Machine Extension. This object mirrors the definition in HybridCompute. */ -@Fluent -public final class ExtensionParameters { - /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * Protected settings (may contain secrets). - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: Protected settings (may contain secrets). - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: Protected settings (may contain secrets). - * - * @param protectedSettings the protectedSettings value to set. - * @return the ExtensionParameters object itself. - */ - public ExtensionParameters withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java deleted file mode 100644 index 0a19e3a728d56..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java +++ /dev/null @@ -1,259 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; -import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Status of Arc Extension for a particular node in HCI Cluster. */ -@Fluent -public final class ExtensionProperties { - /* - * Provisioning state of the Extension proxy resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Parameters specific to this extension type. - */ - @JsonProperty(value = "extensionParameters") - private ExtensionParameters innerExtensionParameters; - - /* - * Aggregate state of Arc Extensions across the nodes in this HCI cluster. - */ - @JsonProperty(value = "aggregateState", access = JsonProperty.Access.WRITE_ONLY) - private ExtensionAggregateState aggregateState; - - /* - * State of Arc Extension in each of the nodes. - */ - @JsonProperty(value = "perNodeExtensionDetails", access = JsonProperty.Access.WRITE_ONLY) - private List perNodeExtensionDetails; - - /** - * Get the provisioningState property: Provisioning state of the Extension proxy resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the innerExtensionParameters property: Parameters specific to this extension type. - * - * @return the innerExtensionParameters value. - */ - private ExtensionParameters innerExtensionParameters() { - return this.innerExtensionParameters; - } - - /** - * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - public ExtensionAggregateState aggregateState() { - return this.aggregateState; - } - - /** - * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. - * - * @return the perNodeExtensionDetails value. - */ - public List perNodeExtensionDetails() { - return this.perNodeExtensionDetails; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withForceUpdateTag(String forceUpdateTag) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withPublisher(String publisher) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withType(String type) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerExtensionParameters() == null - ? null - : this.innerExtensionParameters().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withSettings(Object settings) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: Protected settings (may contain secrets). - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().protectedSettings(); - } - - /** - * Set the protectedSettings property: Protected settings (may contain secrets). - * - * @param protectedSettings the protectedSettings value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withProtectedSettings(Object protectedSettings) { - if (this.innerExtensionParameters() == null) { - this.innerExtensionParameters = new ExtensionParameters(); - } - this.innerExtensionParameters().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerExtensionParameters() != null) { - innerExtensionParameters().validate(); - } - if (perNodeExtensionDetails() != null) { - perNodeExtensionDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageProperties.java new file mode 100644 index 0000000000000..fe985b0dc7420 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageProperties.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties under the gallery image resource. */ +@Fluent +public final class GalleryImageProperties { + /* + * Storage ContainerID of the storage container to be used for gallery image + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * location of the image the gallery image should be created from + */ + @JsonProperty(value = "imagePath") + private String imagePath; + + /* + * Operating system type that the gallery image uses [Windows, Linux] + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] + */ + @JsonProperty(value = "cloudInitDataSource") + private CloudInitDataSource cloudInitDataSource; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "identifier") + private GalleryImageIdentifier identifier; + + /* + * Specifies information about the gallery image version that you want to create or update. + */ + @JsonProperty(value = "version") + private GalleryImageVersion version; + + /* + * Provisioning state of the gallery image. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of gallery images + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImageStatus status; + + /** Creates an instance of GalleryImageProperties class. */ + public GalleryImageProperties() { + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for gallery image. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for gallery image. + * + * @param containerId the containerId value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + public String imagePath() { + return this.imagePath; + } + + /** + * Set the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath the imagePath value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType the osType value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + public CloudInitDataSource cloudInitDataSource() { + return this.cloudInitDataSource; + } + + /** + * Set the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @param cloudInitDataSource the cloudInitDataSource value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + this.cloudInitDataSource = cloudInitDataSource; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + public GalleryImageVersion version() { + return this.version; + } + + /** + * Set the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @param version the version value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withVersion(GalleryImageVersion version) { + this.version = version; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The observed state of gallery images. + * + * @return the status value. + */ + public GalleryImageStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model GalleryImageProperties")); + } + if (identifier() != null) { + identifier().validate(); + } + if (version() != null) { + version().validate(); + } + if (status() != null) { + status().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageProperties.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageVersionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageVersionProperties.java new file mode 100644 index 0000000000000..ad1b2ef34f2a1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageVersionProperties.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a gallery image version. */ +@Fluent +public final class GalleryImageVersionProperties { + /* + * This is the storage profile of a Gallery Image Version. + */ + @JsonProperty(value = "storageProfile", required = true) + private GalleryImageVersionStorageProfile storageProfile; + + /** Creates an instance of GalleryImageVersionProperties class. */ + public GalleryImageVersionProperties() { + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @param storageProfile the storageProfile value to set. + * @return the GalleryImageVersionProperties object itself. + */ + public GalleryImageVersionProperties withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageProfile in model GalleryImageVersionProperties")); + } else { + storageProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageVersionProperties.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImagesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImagesInner.java new file mode 100644 index 0000000000000..9e9bc65db83f7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImagesInner.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The gallery images resource definition. */ +@Fluent +public final class GalleryImagesInner extends Resource { + /* + * Properties under the gallery image resource + */ + @JsonProperty(value = "properties") + private GalleryImageProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of GalleryImagesInner class. */ + public GalleryImagesInner() { + } + + /** + * Get the innerProperties property: Properties under the gallery image resource. + * + * @return the innerProperties value. + */ + private GalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public GalleryImagesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImagesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for gallery image. + * + * @return the containerId value. + */ + public String containerId() { + return this.innerProperties() == null ? null : this.innerProperties().containerId(); + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for gallery image. + * + * @param containerId the containerId value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withContainerId(String containerId) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withContainerId(containerId); + return this; + } + + /** + * Get the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + public String imagePath() { + return this.innerProperties() == null ? null : this.innerProperties().imagePath(); + } + + /** + * Set the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath the imagePath value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withImagePath(String imagePath) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withImagePath(imagePath); + return this; + } + + /** + * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType the osType value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + public CloudInitDataSource cloudInitDataSource() { + return this.innerProperties() == null ? null : this.innerProperties().cloudInitDataSource(); + } + + /** + * Set the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @param cloudInitDataSource the cloudInitDataSource value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withCloudInitDataSource(cloudInitDataSource); + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().identifier(); + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withIdentifier(GalleryImageIdentifier identifier) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIdentifier(identifier); + return this; + } + + /** + * Get the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + public GalleryImageVersion version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @param version the version value to set. + * @return the GalleryImagesInner object itself. + */ + public GalleryImagesInner withVersion(GalleryImageVersion version) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The observed state of gallery images. + * + * @return the status value. + */ + public GalleryImageStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentInner.java new file mode 100644 index 0000000000000..c9c6c1e5b55f5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentInner.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the GuestAgent. */ +@Fluent +public final class GuestAgentInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private GuestAgentProperties innerProperties = new GuestAgentProperties(); + + /** Creates an instance of GuestAgentInner class. */ + public GuestAgentInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private GuestAgentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the credentials property: Username / Password Credentials to provision guest agent. + * + * @return the credentials value. + */ + public GuestCredential credentials() { + return this.innerProperties() == null ? null : this.innerProperties().credentials(); + } + + /** + * Set the credentials property: Username / Password Credentials to provision guest agent. + * + * @param credentials the credentials value to set. + * @return the GuestAgentInner object itself. + */ + public GuestAgentInner withCredentials(GuestCredential credentials) { + if (this.innerProperties() == null) { + this.innerProperties = new GuestAgentProperties(); + } + this.innerProperties().withCredentials(credentials); + return this; + } + + /** + * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @return the httpProxyConfig value. + */ + public HttpProxyConfiguration httpProxyConfig() { + return this.innerProperties() == null ? null : this.innerProperties().httpProxyConfig(); + } + + /** + * Set the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the GuestAgentInner object itself. + */ + public GuestAgentInner withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new GuestAgentProperties(); + } + this.innerProperties().withHttpProxyConfig(httpProxyConfig); + return this; + } + + /** + * Get the provisioningAction property: The guest agent provisioning action. + * + * @return the provisioningAction value. + */ + public ProvisioningAction provisioningAction() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningAction(); + } + + /** + * Set the provisioningAction property: The guest agent provisioning action. + * + * @param provisioningAction the provisioningAction value to set. + * @return the GuestAgentInner object itself. + */ + public GuestAgentInner withProvisioningAction(ProvisioningAction provisioningAction) { + if (this.innerProperties() == null) { + this.innerProperties = new GuestAgentProperties(); + } + this.innerProperties().withProvisioningAction(provisioningAction); + return this; + } + + /** + * Get the status property: The guest agent status. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model GuestAgentInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentInner.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentProperties.java new file mode 100644 index 0000000000000..4200d200e819f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the resource properties. */ +@Fluent +public final class GuestAgentProperties { + /* + * Username / Password Credentials to provision guest agent. + */ + @JsonProperty(value = "credentials") + private GuestCredential credentials; + + /* + * HTTP Proxy configuration for the VM. + */ + @JsonProperty(value = "httpProxyConfig") + private HttpProxyConfiguration httpProxyConfig; + + /* + * The guest agent provisioning action. + */ + @JsonProperty(value = "provisioningAction") + private ProvisioningAction provisioningAction; + + /* + * The guest agent status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of GuestAgentProperties class. */ + public GuestAgentProperties() { + } + + /** + * Get the credentials property: Username / Password Credentials to provision guest agent. + * + * @return the credentials value. + */ + public GuestCredential credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Username / Password Credentials to provision guest agent. + * + * @param credentials the credentials value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withCredentials(GuestCredential credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @return the httpProxyConfig value. + */ + public HttpProxyConfiguration httpProxyConfig() { + return this.httpProxyConfig; + } + + /** + * Set the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { + this.httpProxyConfig = httpProxyConfig; + return this; + } + + /** + * Get the provisioningAction property: The guest agent provisioning action. + * + * @return the provisioningAction value. + */ + public ProvisioningAction provisioningAction() { + return this.provisioningAction; + } + + /** + * Set the provisioningAction property: The guest agent provisioning action. + * + * @param provisioningAction the provisioningAction value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withProvisioningAction(ProvisioningAction provisioningAction) { + this.provisioningAction = provisioningAction; + return this; + } + + /** + * Get the status property: The guest agent status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + if (httpProxyConfig() != null) { + httpProxyConfig().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataInner.java new file mode 100644 index 0000000000000..c5c084ba71a51 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the HybridIdentityMetadata. */ +@Fluent +public final class HybridIdentityMetadataInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties(); + + /** Creates an instance of HybridIdentityMetadataInner class. */ + public HybridIdentityMetadataInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private HybridIdentityMetadataProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the resourceUid property: The unique identifier for the resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceUid(); + } + + /** + * Set the resourceUid property: The unique identifier for the resource. + * + * @param resourceUid the resourceUid value to set. + * @return the HybridIdentityMetadataInner object itself. + */ + public HybridIdentityMetadataInner withResourceUid(String resourceUid) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridIdentityMetadataProperties(); + } + this.innerProperties().withResourceUid(resourceUid); + return this; + } + + /** + * Get the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); + } + + /** + * Set the publicKey property: The Public Key. + * + * @param publicKey the publicKey value to set. + * @return the HybridIdentityMetadataInner object itself. + */ + public HybridIdentityMetadataInner withPublicKey(String publicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridIdentityMetadataProperties(); + } + this.innerProperties().withPublicKey(publicKey); + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.innerProperties() == null ? null : this.innerProperties().identity(); + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model HybridIdentityMetadataInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataInner.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataProperties.java new file mode 100644 index 0000000000000..ed37a83a47fe1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the resource properties. */ +@Fluent +public final class HybridIdentityMetadataProperties { + /* + * The unique identifier for the resource. + */ + @JsonProperty(value = "resourceUid") + private String resourceUid; + + /* + * The Public Key. + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private Identity identity; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of HybridIdentityMetadataProperties class. */ + public HybridIdentityMetadataProperties() { + } + + /** + * Get the resourceUid property: The unique identifier for the resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.resourceUid; + } + + /** + * Set the resourceUid property: The unique identifier for the resource. + * + * @param resourceUid the resourceUid value to set. + * @return the HybridIdentityMetadataProperties object itself. + */ + public HybridIdentityMetadataProperties withResourceUid(String resourceUid) { + this.resourceUid = resourceUid; + return this; + } + + /** + * Get the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: The Public Key. + * + * @param publicKey the publicKey value to set. + * @return the HybridIdentityMetadataProperties object itself. + */ + public HybridIdentityMetadataProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImageProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImageProperties.java new file mode 100644 index 0000000000000..846c79e02b095 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImageProperties.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties under the marketplace gallery image resource. */ +@Fluent +public final class MarketplaceGalleryImageProperties { + /* + * Storage ContainerID of the storage container to be used for marketplace gallery image + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * Operating system type that the gallery image uses [Windows, Linux] + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] + */ + @JsonProperty(value = "cloudInitDataSource") + private CloudInitDataSource cloudInitDataSource; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "identifier") + private GalleryImageIdentifier identifier; + + /* + * Specifies information about the gallery image version that you want to create or update. + */ + @JsonProperty(value = "version") + private GalleryImageVersion version; + + /* + * Provisioning state of the marketplace gallery image. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of marketplace gallery images + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MarketplaceGalleryImageStatus status; + + /** Creates an instance of MarketplaceGalleryImageProperties class. */ + public MarketplaceGalleryImageProperties() { + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery + * image. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery + * image. + * + * @param containerId the containerId value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType the osType value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + public CloudInitDataSource cloudInitDataSource() { + return this.cloudInitDataSource; + } + + /** + * Set the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @param cloudInitDataSource the cloudInitDataSource value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + this.cloudInitDataSource = cloudInitDataSource; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + public GalleryImageVersion version() { + return this.version; + } + + /** + * Set the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @param version the version value to set. + * @return the MarketplaceGalleryImageProperties object itself. + */ + public MarketplaceGalleryImageProperties withVersion(GalleryImageVersion version) { + this.version = version; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the marketplace gallery image. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The observed state of marketplace gallery images. + * + * @return the status value. + */ + public MarketplaceGalleryImageStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model MarketplaceGalleryImageProperties")); + } + if (identifier() != null) { + identifier().validate(); + } + if (version() != null) { + version().validate(); + } + if (status() != null) { + status().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceGalleryImageProperties.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImagesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImagesInner.java new file mode 100644 index 0000000000000..f3e6159a5c308 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImagesInner.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The marketplace gallery image resource definition. */ +@Fluent +public final class MarketplaceGalleryImagesInner extends Resource { + /* + * Properties under the marketplace gallery image resource + */ + @JsonProperty(value = "properties") + private MarketplaceGalleryImageProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of MarketplaceGalleryImagesInner class. */ + public MarketplaceGalleryImagesInner() { + } + + /** + * Get the innerProperties property: Properties under the marketplace gallery image resource. + * + * @return the innerProperties value. + */ + private MarketplaceGalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public MarketplaceGalleryImagesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MarketplaceGalleryImagesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery + * image. + * + * @return the containerId value. + */ + public String containerId() { + return this.innerProperties() == null ? null : this.innerProperties().containerId(); + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery + * image. + * + * @param containerId the containerId value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withContainerId(String containerId) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withContainerId(containerId); + return this; + } + + /** + * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType the osType value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + public CloudInitDataSource cloudInitDataSource() { + return this.innerProperties() == null ? null : this.innerProperties().cloudInitDataSource(); + } + + /** + * Set the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @param cloudInitDataSource the cloudInitDataSource value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withCloudInitDataSource(cloudInitDataSource); + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().identifier(); + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withIdentifier(GalleryImageIdentifier identifier) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withIdentifier(identifier); + return this; + } + + /** + * Get the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + public GalleryImageVersion version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @param version the version value to set. + * @return the MarketplaceGalleryImagesInner object itself. + */ + public MarketplaceGalleryImagesInner withVersion(GalleryImageVersion version) { + if (this.innerProperties() == null) { + this.innerProperties = new MarketplaceGalleryImageProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the marketplace gallery image. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The observed state of marketplace gallery images. + * + * @return the status value. + */ + public MarketplaceGalleryImageStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfaceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfaceProperties.java new file mode 100644 index 0000000000000..f15bd4eed24ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfaceProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaceStatus; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties under the network interface resource. */ +@Fluent +public final class NetworkInterfaceProperties { + /* + * IPConfigurations - A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * MacAddress - The MAC address of the network interface. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /* + * DNS Settings for the interface + */ + @JsonProperty(value = "dnsSettings") + private InterfaceDnsSettings dnsSettings; + + /* + * Provisioning state of the network interface. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of network interfaces + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceStatus status; + + /** Creates an instance of NetworkInterfaceProperties class. */ + public NetworkInterfaceProperties() { + } + + /** + * Get the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkInterfaceProperties object itself. + */ + public NetworkInterfaceProperties withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: MacAddress - The MAC address of the network interface. + * + * @param macAddress the macAddress value to set. + * @return the NetworkInterfaceProperties object itself. + */ + public NetworkInterfaceProperties withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + public InterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings the dnsSettings value to set. + * @return the NetworkInterfaceProperties object itself. + */ + public NetworkInterfaceProperties withDnsSettings(InterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the network interface. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The observed state of network interfaces. + * + * @return the status value. + */ + public NetworkInterfaceStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfacesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfacesInner.java new file mode 100644 index 0000000000000..e504f8292c41e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfacesInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaceStatus; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The network interface resource definition. */ +@Fluent +public final class NetworkInterfacesInner extends Resource { + /* + * Properties under the network interface resource + */ + @JsonProperty(value = "properties") + private NetworkInterfaceProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkInterfacesInner class. */ + public NetworkInterfacesInner() { + } + + /** + * Get the innerProperties property: Properties under the network interface resource. + * + * @return the innerProperties value. + */ + private NetworkInterfaceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the NetworkInterfacesInner object itself. + */ + public NetworkInterfacesInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfacesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfacesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Set the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkInterfacesInner object itself. + */ + public NetworkInterfacesInner withIpConfigurations(List ipConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.innerProperties() == null ? null : this.innerProperties().macAddress(); + } + + /** + * Set the macAddress property: MacAddress - The MAC address of the network interface. + * + * @param macAddress the macAddress value to set. + * @return the NetworkInterfacesInner object itself. + */ + public NetworkInterfacesInner withMacAddress(String macAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceProperties(); + } + this.innerProperties().withMacAddress(macAddress); + return this; + } + + /** + * Get the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + public InterfaceDnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings the dnsSettings value to set. + * @return the NetworkInterfacesInner object itself. + */ + public NetworkInterfacesInner withDnsSettings(InterfaceDnsSettings dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the network interface. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The observed state of network interfaces. + * + * @return the status value. + */ + public NetworkInterfaceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java deleted file mode 100644 index cd70af853a48e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java +++ /dev/null @@ -1,58 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.azurestackhci.models.Operation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResultInner { - /* - * List of operations supported by the resource provider - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java deleted file mode 100644 index 92abc341b7391..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java +++ /dev/null @@ -1,125 +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.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The PasswordCredential model. */ -@Fluent -public final class PasswordCredentialInner { - /* - * The secretText property. - */ - @JsonProperty(value = "secretText") - private String secretText; - - /* - * The keyId property. - */ - @JsonProperty(value = "keyId") - private String keyId; - - /* - * The startDateTime property. - */ - @JsonProperty(value = "startDateTime") - private OffsetDateTime startDateTime; - - /* - * The endDateTime property. - */ - @JsonProperty(value = "endDateTime") - private OffsetDateTime endDateTime; - - /** - * Get the secretText property: The secretText property. - * - * @return the secretText value. - */ - public String secretText() { - return this.secretText; - } - - /** - * Set the secretText property: The secretText property. - * - * @param secretText the secretText value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withSecretText(String secretText) { - this.secretText = secretText; - return this; - } - - /** - * Get the keyId property: The keyId property. - * - * @return the keyId value. - */ - public String keyId() { - return this.keyId; - } - - /** - * Set the keyId property: The keyId property. - * - * @param keyId the keyId value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withKeyId(String keyId) { - this.keyId = keyId; - return this; - } - - /** - * Get the startDateTime property: The startDateTime property. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.startDateTime; - } - - /** - * Set the startDateTime property: The startDateTime property. - * - * @param startDateTime the startDateTime value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withStartDateTime(OffsetDateTime startDateTime) { - this.startDateTime = startDateTime; - return this; - } - - /** - * Get the endDateTime property: The endDateTime property. - * - * @return the endDateTime value. - */ - public OffsetDateTime endDateTime() { - return this.endDateTime; - } - - /** - * Set the endDateTime property: The endDateTime property. - * - * @param endDateTime the endDateTime value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withEndDateTime(OffsetDateTime endDateTime) { - this.endDateTime = endDateTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainerProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainerProperties.java new file mode 100644 index 0000000000000..56ed744c26101 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainerProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties under the storage container resource. */ +@Fluent +public final class StorageContainerProperties { + /* + * Path of the storage container on the disk + */ + @JsonProperty(value = "path") + private String path; + + /* + * Provisioning state of the storage container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of storage containers + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StorageContainerStatus status; + + /** Creates an instance of StorageContainerProperties class. */ + public StorageContainerProperties() { + } + + /** + * Get the path property: Path of the storage container on the disk. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path of the storage container on the disk. + * + * @param path the path value to set. + * @return the StorageContainerProperties object itself. + */ + public StorageContainerProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the storage container. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The observed state of storage containers. + * + * @return the status value. + */ + public StorageContainerStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainersInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainersInner.java new file mode 100644 index 0000000000000..046491d1e9927 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainersInner.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The storage container resource definition. */ +@Fluent +public final class StorageContainersInner extends Resource { + /* + * Properties under the storage container resource + */ + @JsonProperty(value = "properties") + private StorageContainerProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of StorageContainersInner class. */ + public StorageContainersInner() { + } + + /** + * Get the innerProperties property: Properties under the storage container resource. + * + * @return the innerProperties value. + */ + private StorageContainerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageContainersInner object itself. + */ + public StorageContainersInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public StorageContainersInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageContainersInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the path property: Path of the storage container on the disk. + * + * @return the path value. + */ + public String path() { + return this.innerProperties() == null ? null : this.innerProperties().path(); + } + + /** + * Set the path property: Path of the storage container on the disk. + * + * @param path the path value to set. + * @return the StorageContainersInner object itself. + */ + public StorageContainersInner withPath(String path) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageContainerProperties(); + } + this.innerProperties().withPath(path); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the storage container. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The observed state of storage containers. + * + * @return the status value. + */ + public StorageContainerStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDiskProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDiskProperties.java new file mode 100644 index 0000000000000..1b424339cfaec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDiskProperties.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.DiskFileFormat; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties under the virtual hard disk resource. */ +@Fluent +public final class VirtualHardDiskProperties { + /* + * The blockSizeBytes property. + */ + @JsonProperty(value = "blockSizeBytes") + private Integer blockSizeBytes; + + /* + * Size of the disk in GB + */ + @JsonProperty(value = "diskSizeGB") + private Long diskSizeGB; + + /* + * Boolean for enabling dynamic sizing on the virtual hard disk + */ + @JsonProperty(value = "dynamic") + private Boolean dynamic; + + /* + * The logicalSectorBytes property. + */ + @JsonProperty(value = "logicalSectorBytes") + private Integer logicalSectorBytes; + + /* + * The physicalSectorBytes property. + */ + @JsonProperty(value = "physicalSectorBytes") + private Integer physicalSectorBytes; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * The format of the actual VHD file [vhd, vhdx] + */ + @JsonProperty(value = "diskFileFormat") + private DiskFileFormat diskFileFormat; + + /* + * Provisioning state of the virtual hard disk. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * Storage ContainerID of the storage container to be used for VHD + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * The observed state of virtual hard disks + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private VirtualHardDiskStatus status; + + /** Creates an instance of VirtualHardDiskProperties class. */ + public VirtualHardDiskProperties() { + } + + /** + * Get the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + public Integer blockSizeBytes() { + return this.blockSizeBytes; + } + + /** + * Set the blockSizeBytes property: The blockSizeBytes property. + * + * @param blockSizeBytes the blockSizeBytes value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withBlockSizeBytes(Integer blockSizeBytes) { + this.blockSizeBytes = blockSizeBytes; + return this; + } + + /** + * Get the diskSizeGB property: Size of the disk in GB. + * + * @return the diskSizeGB value. + */ + public Long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Size of the disk in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withDiskSizeGB(Long diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + public Boolean dynamic() { + return this.dynamic; + } + + /** + * Set the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic the dynamic value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withDynamic(Boolean dynamic) { + this.dynamic = dynamic; + return this; + } + + /** + * Get the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + public Integer logicalSectorBytes() { + return this.logicalSectorBytes; + } + + /** + * Set the logicalSectorBytes property: The logicalSectorBytes property. + * + * @param logicalSectorBytes the logicalSectorBytes value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withLogicalSectorBytes(Integer logicalSectorBytes) { + this.logicalSectorBytes = logicalSectorBytes; + return this; + } + + /** + * Get the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + public Integer physicalSectorBytes() { + return this.physicalSectorBytes; + } + + /** + * Set the physicalSectorBytes property: The physicalSectorBytes property. + * + * @param physicalSectorBytes the physicalSectorBytes value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withPhysicalSectorBytes(Integer physicalSectorBytes) { + this.physicalSectorBytes = physicalSectorBytes; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @return the diskFileFormat value. + */ + public DiskFileFormat diskFileFormat() { + return this.diskFileFormat; + } + + /** + * Set the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @param diskFileFormat the diskFileFormat value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withDiskFileFormat(DiskFileFormat diskFileFormat) { + this.diskFileFormat = diskFileFormat; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual hard disk. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @param containerId the containerId value to set. + * @return the VirtualHardDiskProperties object itself. + */ + public VirtualHardDiskProperties withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the status property: The observed state of virtual hard disks. + * + * @return the status value. + */ + public VirtualHardDiskStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDisksInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDisksInner.java new file mode 100644 index 0000000000000..a335eb5f2d37e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDisksInner.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.DiskFileFormat; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtual hard disk resource definition. */ +@Fluent +public final class VirtualHardDisksInner extends Resource { + /* + * Properties under the virtual hard disk resource + */ + @JsonProperty(value = "properties") + private VirtualHardDiskProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualHardDisksInner class. */ + public VirtualHardDisksInner() { + } + + /** + * Get the innerProperties property: Properties under the virtual hard disk resource. + * + * @return the innerProperties value. + */ + private VirtualHardDiskProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VirtualHardDisksInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualHardDisksInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + public Integer blockSizeBytes() { + return this.innerProperties() == null ? null : this.innerProperties().blockSizeBytes(); + } + + /** + * Set the blockSizeBytes property: The blockSizeBytes property. + * + * @param blockSizeBytes the blockSizeBytes value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withBlockSizeBytes(Integer blockSizeBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withBlockSizeBytes(blockSizeBytes); + return this; + } + + /** + * Get the diskSizeGB property: Size of the disk in GB. + * + * @return the diskSizeGB value. + */ + public Long diskSizeGB() { + return this.innerProperties() == null ? null : this.innerProperties().diskSizeGB(); + } + + /** + * Set the diskSizeGB property: Size of the disk in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withDiskSizeGB(Long diskSizeGB) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withDiskSizeGB(diskSizeGB); + return this; + } + + /** + * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + public Boolean dynamic() { + return this.innerProperties() == null ? null : this.innerProperties().dynamic(); + } + + /** + * Set the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic the dynamic value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withDynamic(Boolean dynamic) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withDynamic(dynamic); + return this; + } + + /** + * Get the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + public Integer logicalSectorBytes() { + return this.innerProperties() == null ? null : this.innerProperties().logicalSectorBytes(); + } + + /** + * Set the logicalSectorBytes property: The logicalSectorBytes property. + * + * @param logicalSectorBytes the logicalSectorBytes value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withLogicalSectorBytes(Integer logicalSectorBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withLogicalSectorBytes(logicalSectorBytes); + return this; + } + + /** + * Get the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + public Integer physicalSectorBytes() { + return this.innerProperties() == null ? null : this.innerProperties().physicalSectorBytes(); + } + + /** + * Set the physicalSectorBytes property: The physicalSectorBytes property. + * + * @param physicalSectorBytes the physicalSectorBytes value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withPhysicalSectorBytes(Integer physicalSectorBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withPhysicalSectorBytes(physicalSectorBytes); + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Get the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @return the diskFileFormat value. + */ + public DiskFileFormat diskFileFormat() { + return this.innerProperties() == null ? null : this.innerProperties().diskFileFormat(); + } + + /** + * Set the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @param diskFileFormat the diskFileFormat value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withDiskFileFormat(DiskFileFormat diskFileFormat) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withDiskFileFormat(diskFileFormat); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual hard disk. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @return the containerId value. + */ + public String containerId() { + return this.innerProperties() == null ? null : this.innerProperties().containerId(); + } + + /** + * Set the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @param containerId the containerId value to set. + * @return the VirtualHardDisksInner object itself. + */ + public VirtualHardDisksInner withContainerId(String containerId) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHardDiskProperties(); + } + this.innerProperties().withContainerId(containerId); + return this; + } + + /** + * Get the status property: The observed state of virtual hard disks. + * + * @return the status value. + */ + public VirtualHardDiskStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceInner.java new file mode 100644 index 0000000000000..9ceab364aeb26 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceInner.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual machine instance resource definition. */ +@Fluent +public final class VirtualMachineInstanceInner extends ProxyResource { + /* + * Properties under the virtual machine instance resource + */ + @JsonProperty(value = "properties") + private VirtualMachineInstanceProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualMachineInstanceInner class. */ + public VirtualMachineInstanceInner() { + } + + /** + * Get the innerProperties property: Properties under the virtual machine instance resource. + * + * @return the innerProperties value. + */ + private VirtualMachineInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @return the hardwareProfile value. + */ + public VirtualMachineInstancePropertiesHardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withHardwareProfile( + VirtualMachineInstancePropertiesHardwareProfile hardwareProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withHardwareProfile(hardwareProfile); + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine + * instance. + * + * @return the networkProfile value. + */ + public VirtualMachineInstancePropertiesNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network configuration the virtual machine + * instance. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withNetworkProfile( + VirtualMachineInstancePropertiesNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + public VirtualMachineInstancePropertiesOsProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withOsProfile(VirtualMachineInstancePropertiesOsProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine + * instance. + * + * @return the securityProfile value. + */ + public VirtualMachineInstancePropertiesSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine + * instance. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withSecurityProfile( + VirtualMachineInstancePropertiesSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine instance. + * + * @return the storageProfile value. + */ + public VirtualMachineInstancePropertiesStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine instance. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withStorageProfile( + VirtualMachineInstancePropertiesStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual machine instance. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the status property: The observed state of virtual machine instances. + * + * @return the status value. + */ + public VirtualMachineInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the guestAgentInstallStatus property: Guest agent install status. + * + * @return the guestAgentInstallStatus value. + */ + public GuestAgentInstallStatus guestAgentInstallStatus() { + return this.innerProperties() == null ? null : this.innerProperties().guestAgentInstallStatus(); + } + + /** + * Set the guestAgentInstallStatus property: Guest agent install status. + * + * @param guestAgentInstallStatus the guestAgentInstallStatus value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withGuestAgentInstallStatus(GuestAgentInstallStatus guestAgentInstallStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withGuestAgentInstallStatus(guestAgentInstallStatus); + return this; + } + + /** + * Get the vmId property: Unique identifier for the vm resource. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Get the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceUid(); + } + + /** + * Set the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. + * + * @param resourceUid the resourceUid value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withResourceUid(String resourceUid) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withResourceUid(resourceUid); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceProperties.java new file mode 100644 index 0000000000000..24a09099f2f69 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties under the virtual machine instance resource. */ +@Fluent +public final class VirtualMachineInstanceProperties { + /* + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ + @JsonProperty(value = "hardwareProfile") + private VirtualMachineInstancePropertiesHardwareProfile hardwareProfile; + + /* + * NetworkProfile - describes the network configuration the virtual machine instance + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineInstancePropertiesNetworkProfile networkProfile; + + /* + * OsProfile - describes the configuration of the operating system and sets login data + */ + @JsonProperty(value = "osProfile") + private VirtualMachineInstancePropertiesOsProfile osProfile; + + /* + * SecurityProfile - Specifies the security settings for the virtual machine instance. + */ + @JsonProperty(value = "securityProfile") + private VirtualMachineInstancePropertiesSecurityProfile securityProfile; + + /* + * StorageProfile - contains information about the disks and storage information for the virtual machine instance + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineInstancePropertiesStorageProfile storageProfile; + + /* + * Provisioning state of the virtual machine instance. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineInstanceView instanceView; + + /* + * The observed state of virtual machine instances + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineInstanceStatus status; + + /* + * Guest agent install status. + */ + @JsonProperty(value = "guestAgentInstallStatus") + private GuestAgentInstallStatus guestAgentInstallStatus; + + /* + * Unique identifier for the vm resource. + */ + @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * Unique identifier defined by ARC to identify the guest of the VM. + */ + @JsonProperty(value = "resourceUid") + private String resourceUid; + + /** Creates an instance of VirtualMachineInstanceProperties class. */ + public VirtualMachineInstanceProperties() { + } + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @return the hardwareProfile value. + */ + public VirtualMachineInstancePropertiesHardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withHardwareProfile( + VirtualMachineInstancePropertiesHardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine + * instance. + * + * @return the networkProfile value. + */ + public VirtualMachineInstancePropertiesNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network configuration the virtual machine + * instance. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withNetworkProfile( + VirtualMachineInstancePropertiesNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + public VirtualMachineInstancePropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withOsProfile(VirtualMachineInstancePropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine + * instance. + * + * @return the securityProfile value. + */ + public VirtualMachineInstancePropertiesSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine + * instance. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withSecurityProfile( + VirtualMachineInstancePropertiesSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine instance. + * + * @return the storageProfile value. + */ + public VirtualMachineInstancePropertiesStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine instance. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withStorageProfile( + VirtualMachineInstancePropertiesStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual machine instance. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the status property: The observed state of virtual machine instances. + * + * @return the status value. + */ + public VirtualMachineInstanceStatus status() { + return this.status; + } + + /** + * Get the guestAgentInstallStatus property: Guest agent install status. + * + * @return the guestAgentInstallStatus value. + */ + public GuestAgentInstallStatus guestAgentInstallStatus() { + return this.guestAgentInstallStatus; + } + + /** + * Set the guestAgentInstallStatus property: Guest agent install status. + * + * @param guestAgentInstallStatus the guestAgentInstallStatus value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withGuestAgentInstallStatus( + GuestAgentInstallStatus guestAgentInstallStatus) { + this.guestAgentInstallStatus = guestAgentInstallStatus; + return this; + } + + /** + * Get the vmId property: Unique identifier for the vm resource. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.resourceUid; + } + + /** + * Set the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. + * + * @param resourceUid the resourceUid value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withResourceUid(String resourceUid) { + this.resourceUid = resourceUid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (status() != null) { + status().validate(); + } + if (guestAgentInstallStatus() != null) { + guestAgentInstallStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkProperties.java new file mode 100644 index 0000000000000..fdd42637bf26c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.NetworkTypeEnum; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesSubnetsItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties under the virtual network resource. */ +@Fluent +public final class VirtualNetworkProperties { + /* + * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP + * option for a subnet overrides VNET DHCP options. + */ + @JsonProperty(value = "dhcpOptions") + private VirtualNetworkPropertiesDhcpOptions dhcpOptions; + + /* + * Type of the network + */ + @JsonProperty(value = "networkType") + private NetworkTypeEnum networkType; + + /* + * Subnet - list of subnets under the virtual network + */ + @JsonProperty(value = "subnets") + private List subnets; + + /* + * Provisioning state of the virtual network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * name of the network switch to be used for VMs + */ + @JsonProperty(value = "vmSwitchName") + private String vmSwitchName; + + /* + * The observed state of virtual networks + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkStatus status; + + /** Creates an instance of VirtualNetworkProperties class. */ + public VirtualNetworkProperties() { + } + + /** + * Get the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + * + * @return the dhcpOptions value. + */ + public VirtualNetworkPropertiesDhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + * + * @param dhcpOptions the dhcpOptions value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withDhcpOptions(VirtualNetworkPropertiesDhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get the networkType property: Type of the network. + * + * @return the networkType value. + */ + public NetworkTypeEnum networkType() { + return this.networkType; + } + + /** + * Set the networkType property: Type of the network. + * + * @param networkType the networkType value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withNetworkType(NetworkTypeEnum networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets the subnets value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual network. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the vmSwitchName property: name of the network switch to be used for VMs. + * + * @return the vmSwitchName value. + */ + public String vmSwitchName() { + return this.vmSwitchName; + } + + /** + * Set the vmSwitchName property: name of the network switch to be used for VMs. + * + * @param vmSwitchName the vmSwitchName value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withVmSwitchName(String vmSwitchName) { + this.vmSwitchName = vmSwitchName; + return this; + } + + /** + * Get the status property: The observed state of virtual networks. + * + * @return the status value. + */ + public VirtualNetworkStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dhcpOptions() != null) { + dhcpOptions().validate(); + } + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemAutoGenerated.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemAutoGenerated.java new file mode 100644 index 0000000000000..82d4bee102b6b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemAutoGenerated.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable; +import com.azure.resourcemanager.azurestackhci.models.IpAllocationMethodEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SubnetProperties - Properties of the subnet. */ +@Fluent +public final class VirtualNetworkPropertiesSubnetsItemAutoGenerated { + /* + * Cidr for this subnet - IPv4, IPv6 + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * AddressPrefixes - List of address prefixes for the subnet. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' + */ + @JsonProperty(value = "ipAllocationMethod") + private IpAllocationMethodEnum ipAllocationMethod; + + /* + * IPConfigurationReferences - list of IPConfigurationReferences + */ + @JsonProperty(value = "ipConfigurationReferences") + private List ipConfigurationReferences; + + /* + * RouteTable for the subnet + */ + @JsonProperty(value = "routeTable") + private ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable; + + /* + * Vlan to use for the subnet + */ + @JsonProperty(value = "vlan") + private Integer vlan; + + /** Creates an instance of VirtualNetworkPropertiesSubnetsItemAutoGenerated class. */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated() { + } + + /** + * Get the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @return the ipAllocationMethod value. + */ + public IpAllocationMethodEnum ipAllocationMethod() { + return this.ipAllocationMethod; + } + + /** + * Set the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withIpAllocationMethod( + IpAllocationMethodEnum ipAllocationMethod) { + this.ipAllocationMethod = ipAllocationMethod; + return this; + } + + /** + * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @return the ipConfigurationReferences value. + */ + public List ipConfigurationReferences() { + return this.ipConfigurationReferences; + } + + /** + * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @param ipConfigurationReferences the ipConfigurationReferences value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withIpConfigurationReferences( + List ipConfigurationReferences) { + this.ipConfigurationReferences = ipConfigurationReferences; + return this; + } + + /** + * Get the routeTable property: RouteTable for the subnet. + * + * @return the routeTable value. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable property: RouteTable for the subnet. + * + * @param routeTable the routeTable value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withRouteTable( + ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the vlan property: Vlan to use for the subnet. + * + * @return the vlan value. + */ + public Integer vlan() { + return this.vlan; + } + + /** + * Set the vlan property: Vlan to use for the subnet. + * + * @param vlan the vlan value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGenerated withVlan(Integer vlan) { + this.vlan = vlan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurationReferences() != null) { + ipConfigurationReferences().forEach(e -> e.validate()); + } + if (routeTable() != null) { + routeTable().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem.java new file mode 100644 index 0000000000000..cfedd5fe3fc69 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RoutePropertiesFormat - Properties of the route. */ +@Fluent +public final class VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem { + /* + * AddressPrefix - The destination CIDR to which the route applies. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes + * where the next hop type is VirtualAppliance. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** Creates an instance of VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem class. */ + public VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem() { + } + + /** + * Get the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworksInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworksInner.java new file mode 100644 index 0000000000000..fb1e0d1583509 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualNetworksInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.NetworkTypeEnum; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesSubnetsItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The virtual network resource definition. */ +@Fluent +public final class VirtualNetworksInner extends Resource { + /* + * Properties under the virtual network resource + */ + @JsonProperty(value = "properties") + private VirtualNetworkProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualNetworksInner class. */ + public VirtualNetworksInner() { + } + + /** + * Get the innerProperties property: Properties under the virtual network resource. + * + * @return the innerProperties value. + */ + private VirtualNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualNetworksInner object itself. + */ + public VirtualNetworksInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworksInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworksInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + * + * @return the dhcpOptions value. + */ + public VirtualNetworkPropertiesDhcpOptions dhcpOptions() { + return this.innerProperties() == null ? null : this.innerProperties().dhcpOptions(); + } + + /** + * Set the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + * + * @param dhcpOptions the dhcpOptions value to set. + * @return the VirtualNetworksInner object itself. + */ + public VirtualNetworksInner withDhcpOptions(VirtualNetworkPropertiesDhcpOptions dhcpOptions) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withDhcpOptions(dhcpOptions); + return this; + } + + /** + * Get the networkType property: Type of the network. + * + * @return the networkType value. + */ + public NetworkTypeEnum networkType() { + return this.innerProperties() == null ? null : this.innerProperties().networkType(); + } + + /** + * Set the networkType property: Type of the network. + * + * @param networkType the networkType value to set. + * @return the VirtualNetworksInner object itself. + */ + public VirtualNetworksInner withNetworkType(NetworkTypeEnum networkType) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withNetworkType(networkType); + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().subnets(); + } + + /** + * Set the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets the subnets value to set. + * @return the VirtualNetworksInner object itself. + */ + public VirtualNetworksInner withSubnets(List subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withSubnets(subnets); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the virtual network. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vmSwitchName property: name of the network switch to be used for VMs. + * + * @return the vmSwitchName value. + */ + public String vmSwitchName() { + return this.innerProperties() == null ? null : this.innerProperties().vmSwitchName(); + } + + /** + * Set the vmSwitchName property: name of the network switch to be used for VMs. + * + * @param vmSwitchName the vmSwitchName value to set. + * @return the VirtualNetworksInner object itself. + */ + public VirtualNetworksInner withVmSwitchName(String vmSwitchName) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withVmSwitchName(vmSwitchName); + return this; + } + + /** + * Get the status property: The observed state of virtual networks. + * + * @return the status value. + */ + public VirtualNetworkStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java deleted file mode 100644 index d0fa03aff9ea7..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java +++ /dev/null @@ -1,45 +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.azurestackhci.implementation; - -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; - -public final class ArcIdentityResponseImpl implements ArcIdentityResponse { - private ArcIdentityResponseInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - ArcIdentityResponseImpl( - ArcIdentityResponseInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String arcApplicationClientId() { - return this.innerModel().arcApplicationClientId(); - } - - public String arcApplicationTenantId() { - return this.innerModel().arcApplicationTenantId(); - } - - public String arcServicePrincipalObjectId() { - return this.innerModel().arcServicePrincipalObjectId(); - } - - public String arcApplicationObjectId() { - return this.innerModel().arcApplicationObjectId(); - } - - public ArcIdentityResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java deleted file mode 100644 index e7c22ee4ecd1a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java +++ /dev/null @@ -1,251 +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.azurestackhci.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; -import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; -import com.azure.resourcemanager.azurestackhci.models.PerNodeState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition, ArcSetting.Update { - private ArcSettingInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String arcInstanceResourceGroup() { - return this.innerModel().arcInstanceResourceGroup(); - } - - public String arcApplicationClientId() { - return this.innerModel().arcApplicationClientId(); - } - - public String arcApplicationTenantId() { - return this.innerModel().arcApplicationTenantId(); - } - - public String arcServicePrincipalObjectId() { - return this.innerModel().arcServicePrincipalObjectId(); - } - - public String arcApplicationObjectId() { - return this.innerModel().arcApplicationObjectId(); - } - - public ArcSettingAggregateState aggregateState() { - return this.innerModel().aggregateState(); - } - - public List perNodeDetails() { - List inner = this.innerModel().perNodeDetails(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Object connectivityProperties() { - return this.innerModel().connectivityProperties(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ArcSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String clusterName; - - private String arcSettingName; - - private ArcSettingsPatch updateArcSetting; - - public ArcSettingImpl withExistingCluster(String resourceGroupName, String clusterName) { - this.resourceGroupName = resourceGroupName; - this.clusterName = clusterName; - return this; - } - - public ArcSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ArcSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - ArcSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = new ArcSettingInner(); - this.serviceManager = serviceManager; - this.arcSettingName = name; - } - - public ArcSettingImpl update() { - this.updateArcSetting = new ArcSettingsPatch(); - return this; - } - - public ArcSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, Context.NONE) - .getValue(); - return this; - } - - public ArcSetting apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, context) - .getValue(); - return this; - } - - ArcSettingImpl( - ArcSettingInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - this.arcSettingName = Utils.getValueFromIdByName(innerObject.id(), "arcSettings"); - } - - public ArcSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE) - .getValue(); - return this; - } - - public ArcSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getArcSettings() - .getWithResponse(resourceGroupName, clusterName, arcSettingName, context) - .getValue(); - return this; - } - - public PasswordCredential generatePassword() { - return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); - } - - public Response generatePasswordWithResponse(Context context) { - return serviceManager - .arcSettings() - .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); - } - - public ArcIdentityResponse createIdentity() { - return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); - } - - public ArcIdentityResponse createIdentity(Context context) { - return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName, context); - } - - public ArcSettingImpl withArcInstanceResourceGroup(String arcInstanceResourceGroup) { - this.innerModel().withArcInstanceResourceGroup(arcInstanceResourceGroup); - return this; - } - - public ArcSettingImpl withArcApplicationClientId(String arcApplicationClientId) { - this.innerModel().withArcApplicationClientId(arcApplicationClientId); - return this; - } - - public ArcSettingImpl withArcApplicationTenantId(String arcApplicationTenantId) { - this.innerModel().withArcApplicationTenantId(arcApplicationTenantId); - return this; - } - - public ArcSettingImpl withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { - this.innerModel().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); - return this; - } - - public ArcSettingImpl withArcApplicationObjectId(String arcApplicationObjectId) { - this.innerModel().withArcApplicationObjectId(arcApplicationObjectId); - return this; - } - - public ArcSettingImpl withConnectivityProperties(Object connectivityProperties) { - if (isInCreateMode()) { - this.innerModel().withConnectivityProperties(connectivityProperties); - return this; - } else { - this.updateArcSetting.withConnectivityProperties(connectivityProperties); - return this; - } - } - - public ArcSettingImpl withTags(Map tags) { - this.updateArcSetting.withTags(tags); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java deleted file mode 100644 index e7fc8d055b322..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java +++ /dev/null @@ -1,238 +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.azurestackhci.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.azurestackhci.fluent.ArcSettingsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import com.azure.resourcemanager.azurestackhci.models.ArcSettings; -import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; - -public final class ArcSettingsImpl implements ArcSettings { - private static final ClientLogger LOGGER = new ClientLogger(ArcSettingsImpl.class); - - private final ArcSettingsClient innerClient; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public ArcSettingsImpl( - ArcSettingsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); - return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); - } - - public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - PagedIterable inner = - this.serviceClient().listByCluster(resourceGroupName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); - } - - public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { - ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new ArcSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, clusterName, arcSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ArcSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String clusterName, String arcSettingName) { - this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName); - } - - public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); - } - - public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { - PasswordCredentialInner inner = - this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new PasswordCredentialImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - Response inner = - this.serviceClient().generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PasswordCredentialImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { - ArcIdentityResponseInner inner = - this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new ArcIdentityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public ArcIdentityResponse createIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - ArcIdentityResponseInner inner = - this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName, context); - if (inner != null) { - return new ArcIdentityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public ArcSetting 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - this.delete(resourceGroupName, clusterName, arcSettingName, Context.NONE); - } - - public void 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - this.delete(resourceGroupName, clusterName, arcSettingName, context); - } - - private ArcSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - public ArcSettingImpl define(String name) { - return new ArcSettingImpl(name, this.manager()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index 31e4c5141f028..a68487f0b8c27 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java @@ -119,24 +119,26 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureStackHciClientImpl client = new AzureStackHciClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index 773a2426d48da..84a242a386941 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java @@ -22,11 +22,17 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; -import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; -import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; -import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.GalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsClient; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.azurestackhci.fluent.MarketplaceGalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.NetworkInterfacesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.StorageContainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualHardDisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualNetworksOperationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -111,52 +117,124 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ArcSettingsClient object to access its operations. */ - private final ArcSettingsClient arcSettings; + /** The GalleryImagesOperationsClient object to access its operations. */ + private final GalleryImagesOperationsClient galleryImagesOperations; /** - * Gets the ArcSettingsClient object to access its operations. + * Gets the GalleryImagesOperationsClient object to access its operations. * - * @return the ArcSettingsClient object. + * @return the GalleryImagesOperationsClient object. */ - public ArcSettingsClient getArcSettings() { - return this.arcSettings; + public GalleryImagesOperationsClient getGalleryImagesOperations() { + return this.galleryImagesOperations; } - /** The ClustersClient object to access its operations. */ - private final ClustersClient clusters; + /** The MarketplaceGalleryImagesOperationsClient object to access its operations. */ + private final MarketplaceGalleryImagesOperationsClient marketplaceGalleryImagesOperations; /** - * Gets the ClustersClient object to access its operations. + * Gets the MarketplaceGalleryImagesOperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the MarketplaceGalleryImagesOperationsClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public MarketplaceGalleryImagesOperationsClient getMarketplaceGalleryImagesOperations() { + return this.marketplaceGalleryImagesOperations; } - /** The ExtensionsClient object to access its operations. */ - private final ExtensionsClient extensions; + /** The NetworkInterfacesOperationsClient object to access its operations. */ + private final NetworkInterfacesOperationsClient networkInterfacesOperations; /** - * Gets the ExtensionsClient object to access its operations. + * Gets the NetworkInterfacesOperationsClient object to access its operations. * - * @return the ExtensionsClient object. + * @return the NetworkInterfacesOperationsClient object. */ - public ExtensionsClient getExtensions() { - return this.extensions; + public NetworkInterfacesOperationsClient getNetworkInterfacesOperations() { + return this.networkInterfacesOperations; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The StorageContainersOperationsClient object to access its operations. */ + private final StorageContainersOperationsClient storageContainersOperations; /** - * Gets the OperationsClient object to access its operations. + * Gets the StorageContainersOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the StorageContainersOperationsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public StorageContainersOperationsClient getStorageContainersOperations() { + return this.storageContainersOperations; + } + + /** The VirtualHardDisksOperationsClient object to access its operations. */ + private final VirtualHardDisksOperationsClient virtualHardDisksOperations; + + /** + * Gets the VirtualHardDisksOperationsClient object to access its operations. + * + * @return the VirtualHardDisksOperationsClient object. + */ + public VirtualHardDisksOperationsClient getVirtualHardDisksOperations() { + return this.virtualHardDisksOperations; + } + + /** The VirtualMachineInstancesClient object to access its operations. */ + private final VirtualMachineInstancesClient virtualMachineInstances; + + /** + * Gets the VirtualMachineInstancesClient object to access its operations. + * + * @return the VirtualMachineInstancesClient object. + */ + public VirtualMachineInstancesClient getVirtualMachineInstances() { + return this.virtualMachineInstances; + } + + /** The HybridIdentityMetadatasClient object to access its operations. */ + private final HybridIdentityMetadatasClient hybridIdentityMetadatas; + + /** + * Gets the HybridIdentityMetadatasClient object to access its operations. + * + * @return the HybridIdentityMetadatasClient object. + */ + public HybridIdentityMetadatasClient getHybridIdentityMetadatas() { + return this.hybridIdentityMetadatas; + } + + /** The GuestAgentsClient object to access its operations. */ + private final GuestAgentsClient guestAgents; + + /** + * Gets the GuestAgentsClient object to access its operations. + * + * @return the GuestAgentsClient object. + */ + public GuestAgentsClient getGuestAgents() { + return this.guestAgents; + } + + /** The GuestAgentsOperationsClient object to access its operations. */ + private final GuestAgentsOperationsClient guestAgentsOperations; + + /** + * Gets the GuestAgentsOperationsClient object to access its operations. + * + * @return the GuestAgentsOperationsClient object. + */ + public GuestAgentsOperationsClient getGuestAgentsOperations() { + return this.guestAgentsOperations; + } + + /** The VirtualNetworksOperationsClient object to access its operations. */ + private final VirtualNetworksOperationsClient virtualNetworksOperations; + + /** + * Gets the VirtualNetworksOperationsClient object to access its operations. + * + * @return the VirtualNetworksOperationsClient object. + */ + public VirtualNetworksOperationsClient getVirtualNetworksOperations() { + return this.virtualNetworksOperations; } /** @@ -181,11 +259,17 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; - this.arcSettings = new ArcSettingsClientImpl(this); - this.clusters = new ClustersClientImpl(this); - this.extensions = new ExtensionsClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.apiVersion = "2023-07-01-preview"; + this.galleryImagesOperations = new GalleryImagesOperationsClientImpl(this); + this.marketplaceGalleryImagesOperations = new MarketplaceGalleryImagesOperationsClientImpl(this); + this.networkInterfacesOperations = new NetworkInterfacesOperationsClientImpl(this); + this.storageContainersOperations = new StorageContainersOperationsClientImpl(this); + this.virtualHardDisksOperations = new VirtualHardDisksOperationsClientImpl(this); + this.virtualMachineInstances = new VirtualMachineInstancesClientImpl(this); + this.hybridIdentityMetadatas = new HybridIdentityMetadatasClientImpl(this); + this.guestAgents = new GuestAgentsClientImpl(this); + this.guestAgentsOperations = new GuestAgentsOperationsClientImpl(this); + this.virtualNetworksOperations = new VirtualNetworksOperationsClientImpl(this); } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java deleted file mode 100644 index bc4eb9adf8bee..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java +++ /dev/null @@ -1,45 +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.azurestackhci.implementation; - -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; - -public final class ClusterIdentityResponseImpl implements ClusterIdentityResponse { - private ClusterIdentityResponseInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - ClusterIdentityResponseImpl( - ClusterIdentityResponseInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String aadClientId() { - return this.innerModel().aadClientId(); - } - - public String aadTenantId() { - return this.innerModel().aadTenantId(); - } - - public String aadServicePrincipalObjectId() { - return this.innerModel().aadServicePrincipalObjectId(); - } - - public String aadApplicationObjectId() { - return this.innerModel().aadApplicationObjectId(); - } - - public ClusterIdentityResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java deleted file mode 100644 index 3bb9fccdd06c7..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ /dev/null @@ -1,319 +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.azurestackhci.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; -import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { - private ClusterInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Status status() { - return this.innerModel().status(); - } - - public String cloudId() { - return this.innerModel().cloudId(); - } - - public String cloudManagementEndpoint() { - return this.innerModel().cloudManagementEndpoint(); - } - - public String aadClientId() { - return this.innerModel().aadClientId(); - } - - public String aadTenantId() { - return this.innerModel().aadTenantId(); - } - - public String aadApplicationObjectId() { - return this.innerModel().aadApplicationObjectId(); - } - - public String aadServicePrincipalObjectId() { - return this.innerModel().aadServicePrincipalObjectId(); - } - - public ClusterDesiredProperties desiredProperties() { - return this.innerModel().desiredProperties(); - } - - public ClusterReportedProperties reportedProperties() { - return this.innerModel().reportedProperties(); - } - - public Float trialDaysRemaining() { - return this.innerModel().trialDaysRemaining(); - } - - public String billingModel() { - return this.innerModel().billingModel(); - } - - public OffsetDateTime registrationTimestamp() { - return this.innerModel().registrationTimestamp(); - } - - public OffsetDateTime lastSyncTimestamp() { - return this.innerModel().lastSyncTimestamp(); - } - - public OffsetDateTime lastBillingTimestamp() { - return this.innerModel().lastBillingTimestamp(); - } - - public String serviceEndpoint() { - return this.innerModel().serviceEndpoint(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ClusterInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String clusterName; - - private ClusterPatch updateCluster; - - public ClusterImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Cluster create() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .createWithResponse(resourceGroupName, clusterName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Cluster create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .createWithResponse(resourceGroupName, clusterName, this.innerModel(), context) - .getValue(); - return this; - } - - ClusterImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = new ClusterInner(); - this.serviceManager = serviceManager; - this.clusterName = name; - } - - public ClusterImpl update() { - this.updateCluster = new ClusterPatch(); - return this; - } - - public Cluster apply() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateCluster, Context.NONE) - .getValue(); - return this; - } - - public Cluster apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateCluster, context) - .getValue(); - return this; - } - - ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - } - - public Cluster refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) - .getValue(); - return this; - } - - public Cluster refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) - .getValue(); - return this; - } - - public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest) { - serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); - } - - public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context) { - serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); - } - - public ClusterIdentityResponse createIdentity() { - return serviceManager.clusters().createIdentity(resourceGroupName, clusterName); - } - - public ClusterIdentityResponse createIdentity(Context context) { - return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); - } - - public ClusterImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ClusterImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ClusterImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateCluster.withTags(tags); - return this; - } - } - - public ClusterImpl withCloudManagementEndpoint(String cloudManagementEndpoint) { - if (isInCreateMode()) { - this.innerModel().withCloudManagementEndpoint(cloudManagementEndpoint); - return this; - } else { - this.updateCluster.withCloudManagementEndpoint(cloudManagementEndpoint); - return this; - } - } - - public ClusterImpl withAadClientId(String aadClientId) { - if (isInCreateMode()) { - this.innerModel().withAadClientId(aadClientId); - return this; - } else { - this.updateCluster.withAadClientId(aadClientId); - return this; - } - } - - public ClusterImpl withAadTenantId(String aadTenantId) { - if (isInCreateMode()) { - this.innerModel().withAadTenantId(aadTenantId); - return this; - } else { - this.updateCluster.withAadTenantId(aadTenantId); - return this; - } - } - - public ClusterImpl withAadApplicationObjectId(String aadApplicationObjectId) { - this.innerModel().withAadApplicationObjectId(aadApplicationObjectId); - return this; - } - - public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { - this.innerModel().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); - return this; - } - - public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { - if (isInCreateMode()) { - this.innerModel().withDesiredProperties(desiredProperties); - return this; - } else { - this.updateCluster.withDesiredProperties(desiredProperties); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java deleted file mode 100644 index 980c49de2240a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ /dev/null @@ -1,204 +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.azurestackhci.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.azurestackhci.fluent.ClustersClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; -import com.azure.resourcemanager.azurestackhci.models.Clusters; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; - -public final class ClustersImpl implements Clusters { - private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); - - private final ClustersClient innerClient; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public ClustersImpl( - ClustersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String clusterName) { - this.serviceClient().delete(resourceGroupName, clusterName); - } - - public void delete(String resourceGroupName, String clusterName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, context); - } - - public void uploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { - this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); - } - - public void uploadCertificate( - String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, - Context context) { - this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); - } - - public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName) { - ClusterIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterIdentityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context) { - ClusterIdentityResponseInner inner = - this.serviceClient().createIdentity(resourceGroupName, clusterName, context); - if (inner != null) { - return new ClusterIdentityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Cluster 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - this.delete(resourceGroupName, clusterName, Context.NONE); - } - - public void 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - this.delete(resourceGroupName, clusterName, context); - } - - private ClustersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - public ClusterImpl define(String name) { - return new ClusterImpl(name, this.manager()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java deleted file mode 100644 index 4340ad680657a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java +++ /dev/null @@ -1,220 +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.azurestackhci.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; -import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import java.util.Collections; -import java.util.List; - -public final class ExtensionImpl implements Extension, Extension.Definition, Extension.Update { - private ExtensionInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ExtensionAggregateState aggregateState() { - return this.innerModel().aggregateState(); - } - - public List perNodeExtensionDetails() { - List inner = this.innerModel().perNodeExtensionDetails(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String forceUpdateTag() { - return this.innerModel().forceUpdateTag(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String typePropertiesType() { - return this.innerModel().typePropertiesType(); - } - - public String typeHandlerVersion() { - return this.innerModel().typeHandlerVersion(); - } - - public Boolean autoUpgradeMinorVersion() { - return this.innerModel().autoUpgradeMinorVersion(); - } - - public Object settings() { - return this.innerModel().settings(); - } - - public Object protectedSettings() { - return this.innerModel().protectedSettings(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ExtensionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String clusterName; - - private String arcSettingName; - - private String extensionName; - - public ExtensionImpl withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName) { - this.resourceGroupName = resourceGroupName; - this.clusterName = clusterName; - this.arcSettingName = arcSettingName; - return this; - } - - public Extension create() { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); - return this; - } - - public Extension create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); - return this; - } - - ExtensionImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = new ExtensionInner(); - this.serviceManager = serviceManager; - this.extensionName = name; - } - - public ExtensionImpl update() { - return this; - } - - public Extension apply() { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); - return this; - } - - public Extension apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); - return this; - } - - ExtensionImpl( - ExtensionInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - this.arcSettingName = Utils.getValueFromIdByName(innerObject.id(), "arcSettings"); - this.extensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); - } - - public Extension refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE) - .getValue(); - return this; - } - - public Extension refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExtensions() - .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context) - .getValue(); - return this; - } - - public ExtensionImpl withForceUpdateTag(String forceUpdateTag) { - this.innerModel().withForceUpdateTag(forceUpdateTag); - return this; - } - - public ExtensionImpl withPublisher(String publisher) { - this.innerModel().withPublisher(publisher); - return this; - } - - public ExtensionImpl withTypePropertiesType(String typePropertiesType) { - this.innerModel().withTypePropertiesType(typePropertiesType); - return this; - } - - public ExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { - this.innerModel().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - public ExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - public ExtensionImpl withSettings(Object settings) { - this.innerModel().withSettings(settings); - return this; - } - - public ExtensionImpl withProtectedSettings(Object protectedSettings) { - this.innerModel().withProtectedSettings(protectedSettings); - return this; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java deleted file mode 100644 index a2ed71822024c..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java +++ /dev/null @@ -1,224 +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.azurestackhci.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.azurestackhci.fluent.ExtensionsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import com.azure.resourcemanager.azurestackhci.models.Extensions; - -public final class ExtensionsImpl implements Extensions { - private static final ClientLogger LOGGER = new ClientLogger(ExtensionsImpl.class); - - private final ExtensionsClient innerClient; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public ExtensionsImpl( - ExtensionsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName) { - PagedIterable inner = - this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName); - return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); - } - - public PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - PagedIterable inner = - this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName, context); - return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); - } - - public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); - if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExtensionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName); - } - - public void delete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); - } - - public Extension 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - return this - .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE); - } - - public void 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); - if (arcSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); - } - - private ExtensionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - public ExtensionImpl define(String name) { - return new ExtensionImpl(name, this.manager()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java new file mode 100644 index 0000000000000..8bf29ac11b7e5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import java.util.Collections; +import java.util.Map; + +public final class GalleryImagesImpl implements GalleryImages, GalleryImages.Definition, GalleryImages.Update { + private GalleryImagesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String containerId() { + return this.innerModel().containerId(); + } + + public String imagePath() { + return this.innerModel().imagePath(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public CloudInitDataSource cloudInitDataSource() { + return this.innerModel().cloudInitDataSource(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public GalleryImageIdentifier identifier() { + return this.innerModel().identifier(); + } + + public GalleryImageVersion version() { + return this.innerModel().version(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public GalleryImageStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GalleryImagesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryImageName; + + private GalleryImagesUpdateRequest updateGalleryImages; + + public GalleryImagesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public GalleryImages create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .createOrUpdate(resourceGroupName, galleryImageName, this.innerModel(), Context.NONE); + return this; + } + + public GalleryImages create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .createOrUpdate(resourceGroupName, galleryImageName, this.innerModel(), context); + return this; + } + + GalleryImagesImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new GalleryImagesInner(); + this.serviceManager = serviceManager; + this.galleryImageName = name; + } + + public GalleryImagesImpl update() { + this.updateGalleryImages = new GalleryImagesUpdateRequest(); + return this; + } + + public GalleryImages apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .update(resourceGroupName, galleryImageName, updateGalleryImages, Context.NONE); + return this; + } + + public GalleryImages apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .update(resourceGroupName, galleryImageName, updateGalleryImages, context); + return this; + } + + GalleryImagesImpl( + GalleryImagesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryImageName = Utils.getValueFromIdByName(innerObject.id(), "galleryImages"); + } + + public GalleryImages refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, galleryImageName, Context.NONE) + .getValue(); + return this; + } + + public GalleryImages refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, galleryImageName, context) + .getValue(); + return this; + } + + public GalleryImagesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryImagesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryImagesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryImages.withTags(tags); + return this; + } + } + + public GalleryImagesImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public GalleryImagesImpl withContainerId(String containerId) { + this.innerModel().withContainerId(containerId); + return this; + } + + public GalleryImagesImpl withImagePath(String imagePath) { + this.innerModel().withImagePath(imagePath); + return this; + } + + public GalleryImagesImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public GalleryImagesImpl withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + this.innerModel().withCloudInitDataSource(cloudInitDataSource); + return this; + } + + public GalleryImagesImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public GalleryImagesImpl withIdentifier(GalleryImageIdentifier identifier) { + this.innerModel().withIdentifier(identifier); + return this; + } + + public GalleryImagesImpl withVersion(GalleryImageVersion version) { + this.innerModel().withVersion(version); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsClientImpl.java similarity index 57% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsClientImpl.java index 0da1463d48572..73a5aead3ecea 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsClientImpl.java @@ -14,7 +14,6 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -33,152 +32,130 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingList; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import com.azure.resourcemanager.azurestackhci.fluent.GalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesListResult; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ArcSettingsClient. */ -public final class ArcSettingsClientImpl implements ArcSettingsClient { +/** An instance of this class provides access to all the operations defined in GalleryImagesOperationsClient. */ +public final class GalleryImagesOperationsClientImpl implements GalleryImagesOperationsClient { /** The proxy service used to perform REST calls. */ - private final ArcSettingsService service; + private final GalleryImagesOperationsService service; /** The service client containing this operation class. */ private final AzureStackHciClientImpl client; /** - * Initializes an instance of ArcSettingsClientImpl. + * Initializes an instance of GalleryImagesOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ArcSettingsClientImpl(AzureStackHciClientImpl client) { + GalleryImagesOperationsClientImpl(AzureStackHciClientImpl client) { this.service = - RestProxy.create(ArcSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy + .create(GalleryImagesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureStackHciClientArcSettings to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureStackHciClientGalleryImagesOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureStackHciClientA") - private interface ArcSettingsService { + @ServiceInterface(name = "AzureStackHciClientG") + public interface GalleryImagesOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/galleryImages/{galleryImageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCluster( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") - @ExpectedResponses({200}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/galleryImages/{galleryImageName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImagesInner galleryImages, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/galleryImages/{galleryImageName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ArcSettingInner arcSetting, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") - @ExpectedResponses({200}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/galleryImages/{galleryImageName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ArcSettingsPatch arcSetting, + @BodyParam("application/json") GalleryImagesUpdateRequest galleryImages, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") - @ExpectedResponses({200, 202, 204}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/galleryImages") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHci/galleryImages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generatePassword( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") - @ExpectedResponses({200, 202}) + @Get("{nextLink}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createIdentity( + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -186,7 +163,7 @@ Mono>> createIdentity( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByClusterNext( + Mono> listAllNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -194,19 +171,18 @@ Mono> listByClusterNext( } /** - * Get ArcSetting resources of HCI Cluster. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param galleryImageName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a gallery image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync( - String resourceGroupName, String clusterName) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryImageName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -223,49 +199,40 @@ private Mono> listByClusterSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByCluster( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + galleryImageName, this.client.getApiVersion(), 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 ArcSetting resources of HCI Cluster. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param galleryImageName Name of the gallery image. * @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 arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a gallery image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryImageName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -282,113 +249,87 @@ private Mono> listByClusterSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCluster( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + galleryImageName, this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Get ArcSetting resources of HCI Cluster. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param galleryImageName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + * @return a gallery image on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>( - () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String galleryImageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get ArcSetting resources of HCI Cluster. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param galleryImageName Name of the gallery image. * @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + * @return a gallery image along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync( - String resourceGroupName, String clusterName, Context context) { - return new PagedFlux<>( - () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); - } - - /** - * Get ArcSetting resources of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryImageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryImageName, context).block(); } /** - * Get ArcSetting resources of HCI Cluster. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. + * @param galleryImageName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + * @return a gallery image. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImagesInner getByResourceGroup(String resourceGroupName, String galleryImageName) { + return getByResourceGroupWithResponse(resourceGroupName, galleryImageName, Context.NONE).getValue(); } /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * @return the gallery images resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -405,45 +346,49 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (galleryImages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImages is required and cannot be null.")); + } else { + galleryImages.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), + galleryImages, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @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 arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * @return the gallery images resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -460,274 +405,211 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (galleryImages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImages is required and cannot be null.")); + } else { + galleryImages.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), + galleryImages, accept, context); } /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of the gallery images resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String clusterName, String arcSettingName) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryImagesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImagesInner.class, + GalleryImagesInner.class, + this.client.getContext()); } /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @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 arcSetting resource details of HCI Cluster. + * @return the {@link PollerFlux} for polling of the gallery images resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { - return getAsync(resourceGroupName, clusterName, arcSettingName).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryImagesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImagesInner.class, GalleryImagesInner.class, context); } /** - * Get ArcSetting resource details of HCI Cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response}. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages) { + return this.beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages).getSyncPoller(); } /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (arcSetting == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); - } else { - arcSetting.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - arcSettingName, - this.client.getApiVersion(), - arcSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context) + .getSyncPoller(); } /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. - * @param context The context to associate with this operation. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + * @return the gallery images resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, - 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (arcSetting == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); - } else { - arcSetting.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - arcSettingName, - this.client.getApiVersion(), - arcSetting, - accept, - context); + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. + * @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 arcSetting details on successful completion of {@link Mono}. + * @return the gallery images resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - return createAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public GalleryImagesInner createOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages) { + return createOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages).block(); } /** - * Create ArcSetting for HCI cluster. + * The operation to create or update a gallery image. Please note some properties can be set only during gallery + * image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource definition. * @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 arcSetting details along with {@link Response}. + * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, - Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public GalleryImagesInner createOrUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).block(); } /** - * Update ArcSettings for HCI cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param galleryImageName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryImageName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -744,55 +626,40 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (arcSetting == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); - } else { - arcSetting.validate(); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), - arcSetting, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update ArcSettings for HCI cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param galleryImageName Name of the gallery image. * @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryImageName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -809,106 +676,174 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (arcSetting == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); - } else { - arcSetting.validate(); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), - arcSetting, accept, context); } /** - * Update ArcSettings for HCI cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param galleryImageName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryImageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryImageName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryImageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryImageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryImageName) { + return this.beginDeleteAsync(resourceGroupName, galleryImageName).getSyncPoller(); + } + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryImageName, Context context) { + return this.beginDeleteAsync(resourceGroupName, galleryImageName, context).getSyncPoller(); + } + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAsync( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { - return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String galleryImageName) { + return beginDeleteAsync(resourceGroupName, galleryImageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update ArcSettings for HCI cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param galleryImageName Name of the gallery image. + * @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 arcSetting details. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + private Mono deleteAsync(String resourceGroupName, String galleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryImageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update ArcSettings for HCI cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param galleryImageName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 galleryImageName) { + deleteAsync(resourceGroupName, galleryImageName).block(); + } + + /** + * The operation to delete a gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryImageName Name of the gallery image. * @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 arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public void delete(String resourceGroupName, String galleryImageName, Context context) { + deleteAsync(resourceGroupName, galleryImageName, context).block(); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the gallery images resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -925,44 +860,48 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (galleryImages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImages is required and cannot be null.")); + } else { + galleryImages.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), + galleryImages, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @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}. + * @return the gallery images resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -979,188 +918,200 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (galleryImages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImages is required and cannot be null.")); + } else { + galleryImages.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + galleryImageName, this.client.getApiVersion(), + galleryImages, accept, context); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, String arcSettingName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + private PollerFlux, GalleryImagesInner> beginUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImagesInner.class, + GalleryImagesInner.class, + this.client.getContext()); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private PollerFlux, GalleryImagesInner> beginUpdateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { context = this.client.mergeContext(context); Mono>> mono = - deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + updateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImagesInner.class, GalleryImagesInner.class, context); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + public SyncPoller, GalleryImagesInner> beginUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + return this.beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages).getSyncPoller(); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + public SyncPoller, GalleryImagesInner> beginUpdate( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + return this.beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).getSyncPoller(); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the gallery images resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName) + private Mono updateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + return beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the gallery images resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context) + private Mono updateAsync( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + return beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String arcSettingName) { - deleteAsync(resourceGroupName, clusterName, arcSettingName).block(); + public GalleryImagesInner update( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + return updateAsync(resourceGroupName, galleryImageName, galleryImages).block(); } /** - * Delete ArcSetting resource details of HCI Cluster. + * The operation to update a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @param galleryImages The gallery images resource patch definition. * @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 gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { - deleteAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public GalleryImagesInner update( + String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + return updateAsync(resourceGroupName, galleryImageName, galleryImages, context).block(); } /** - * Generate password for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generatePasswordWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1177,44 +1128,44 @@ private Mono> generatePasswordWithResponseAsyn return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .generatePassword( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, this.client.getApiVersion(), 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())); } /** - * Generate password for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @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 body along with {@link Response} on successful completion of {@link Mono}. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generatePasswordWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1231,93 +1182,102 @@ private Mono> generatePasswordWithResponseAsyn return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .generatePassword( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Generate password for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body on successful completion of {@link Mono}. + * @return list of gallery images as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generatePasswordAsync( - String resourceGroupName, String clusterName, String arcSettingName) { - return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Generate password for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return list of gallery images as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PasswordCredentialInner generatePassword( - String resourceGroupName, String clusterName, String arcSettingName) { - return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Generate password for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 body along with {@link Response}. + * @return list of gallery images as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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 arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + * @return list of gallery images as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createIdentityWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1330,48 +1290,41 @@ private Mono>> createIdentityWithResponseAsync( 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createIdentity( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - arcSettingName, this.client.getApiVersion(), 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())); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @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 arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createIdentityWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1384,205 +1337,168 @@ private Mono>> createIdentityWithResponseAsync( 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createIdentity( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - arcSettingName, this.client.getApiVersion(), accept, - context); - } - - /** - * Create Aad identity for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of arcIdentity details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( - String resourceGroupName, String clusterName, String arcSettingName) { - Mono>> mono = - createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ArcIdentityResponseInner.class, - ArcIdentityResponseInner.class, - this.client.getContext()); - } - - /** - * Create Aad identity for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of arcIdentity details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ArcIdentityResponseInner.class, - ArcIdentityResponseInner.class, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of arcIdentity details. + * @return list of gallery images as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, String arcSettingName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of arcIdentity details. + * @return list of gallery images as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcIdentity details on successful completion of {@link Mono}. + * @return list of gallery images as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIdentityAsync( - String resourceGroupName, String clusterName, String arcSettingName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Create Aad identity for arc settings. + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @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 arcIdentity details on successful completion of {@link Mono}. + * @return list of gallery images as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIdentityAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Create Aad identity for arc settings. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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 arcIdentity details. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcIdentityResponseInner createIdentity( - String resourceGroupName, String clusterName, String arcSettingName) { - return createIdentityAsync(resourceGroupName, clusterName, arcSettingName).block(); + private Mono> listNextSinglePageAsync(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.listNext(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())); } /** - * Create Aad identity for arc settings. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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 arcIdentity details. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcIdentityResponseInner createIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + private Mono> listNextSinglePageAsync(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 + .listNext(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 nextLink parameter. + * @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 list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink) { + private Mono> listAllNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1594,8 +1510,8 @@ private Mono> listByClusterNextSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1610,16 +1526,16 @@ private Mono> listByClusterNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return list of gallery images along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1632,7 +1548,7 @@ private Mono> listByClusterNextSinglePageAsync(St final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) + .listAllNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsImpl.java new file mode 100644 index 0000000000000..9a34ef3484cc3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.GalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +import com.azure.resourcemanager.azurestackhci.models.GalleryImagesOperations; + +public final class GalleryImagesOperationsImpl implements GalleryImagesOperations { + private static final ClientLogger LOGGER = new ClientLogger(GalleryImagesOperationsImpl.class); + + private final GalleryImagesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public GalleryImagesOperationsImpl( + GalleryImagesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryImageName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, galleryImageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImagesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GalleryImages getByResourceGroup(String resourceGroupName, String galleryImageName) { + GalleryImagesInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, galleryImageName); + if (inner != null) { + return new GalleryImagesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String galleryImageName) { + this.serviceClient().delete(resourceGroupName, galleryImageName); + } + + public void delete(String resourceGroupName, String galleryImageName, Context context) { + this.serviceClient().delete(resourceGroupName, galleryImageName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public GalleryImages 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 galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + if (galleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryImageName, 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 galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + if (galleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryImageName, 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 galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + if (galleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); + } + this.delete(resourceGroupName, galleryImageName, Context.NONE); + } + + public void 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 galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + if (galleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); + } + this.delete(resourceGroupName, galleryImageName, context); + } + + private GalleryImagesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public GalleryImagesImpl define(String name) { + return new GalleryImagesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentImpl.java new file mode 100644 index 0000000000000..c41acf4ed5b88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestAgent; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; + +public final class GuestAgentImpl implements GuestAgent { + private GuestAgentInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + GuestAgentImpl( + GuestAgentInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GuestCredential credentials() { + return this.innerModel().credentials(); + } + + public HttpProxyConfiguration httpProxyConfig() { + return this.innerModel().httpProxyConfig(); + } + + public ProvisioningAction provisioningAction() { + return this.innerModel().provisioningAction(); + } + + public String status() { + return this.innerModel().status(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public GuestAgentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsClientImpl.java new file mode 100644 index 0000000000000..8cb53056e6037 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsClientImpl.java @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GuestAgentsClient. */ +public final class GuestAgentsClientImpl implements GuestAgentsClient { + /** The proxy service used to perform REST calls. */ + private final GuestAgentsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of GuestAgentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GuestAgentsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(GuestAgentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientGuestAgents to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientG") + public interface GuestAgentsService { + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GuestAgentInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceUri, GuestAgentInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceUri, GuestAgentInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuestAgentInner> beginCreateAsync( + String resourceUri, GuestAgentInner body) { + Mono>> mono = createWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GuestAgentInner.class, + GuestAgentInner.class, + this.client.getContext()); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuestAgentInner> beginCreateAsync(String resourceUri) { + final GuestAgentInner body = null; + Mono>> mono = createWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GuestAgentInner.class, + GuestAgentInner.class, + this.client.getContext()); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuestAgentInner> beginCreateAsync( + String resourceUri, GuestAgentInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceUri, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GuestAgentInner.class, GuestAgentInner.class, context); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuestAgentInner> beginCreate(String resourceUri) { + final GuestAgentInner body = null; + return this.beginCreateAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuestAgentInner> beginCreate( + String resourceUri, GuestAgentInner body, Context context) { + return this.beginCreateAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceUri, GuestAgentInner body) { + return beginCreateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceUri) { + final GuestAgentInner body = null; + return beginCreateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceUri, GuestAgentInner body, Context context) { + return beginCreateAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner create(String resourceUri) { + final GuestAgentInner body = null; + return createAsync(resourceUri, body).block(); + } + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner create(String resourceUri, GuestAgentInner body, Context context) { + return createAsync(resourceUri, body, context).block(); + } + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + Mono>> mono = deleteWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri) { + return this.beginDeleteAsync(resourceUri).getSyncPoller(); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri, Context context) { + return this.beginDeleteAsync(resourceUri, context).getSyncPoller(); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + return beginDeleteAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Context context) { + return beginDeleteAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + deleteAsync(resourceUri).block(); + } + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, Context context) { + deleteAsync(resourceUri, context).block(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsImpl.java new file mode 100644 index 0000000000000..9e73baba26567 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsImpl.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.azurestackhci.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestAgent; +import com.azure.resourcemanager.azurestackhci.models.GuestAgents; + +public final class GuestAgentsImpl implements GuestAgents { + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentsImpl.class); + + private final GuestAgentsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public GuestAgentsImpl( + GuestAgentsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GuestAgent create(String resourceUri) { + GuestAgentInner inner = this.serviceClient().create(resourceUri); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public GuestAgent create(String resourceUri, GuestAgentInner body, Context context) { + GuestAgentInner inner = this.serviceClient().create(resourceUri, body, context); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GuestAgentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GuestAgent get(String resourceUri) { + GuestAgentInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Context context) { + this.serviceClient().delete(resourceUri, context); + } + + private GuestAgentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsClientImpl.java new file mode 100644 index 0000000000000..85442299b69fc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsClientImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GuestAgentsOperationsClient. */ +public final class GuestAgentsOperationsClientImpl implements GuestAgentsOperationsClient { + /** The proxy service used to perform REST calls. */ + private final GuestAgentsOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of GuestAgentsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GuestAgentsOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create(GuestAgentsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientGuestAgentsOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientG") + public interface GuestAgentsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), 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())); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of GuestAgent as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of GuestAgent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * 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 list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsImpl.java new file mode 100644 index 0000000000000..18c2360cc8e9a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.GuestAgentsOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestAgent; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentsOperations; + +public final class GuestAgentsOperationsImpl implements GuestAgentsOperations { + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentsOperationsImpl.class); + + private final GuestAgentsOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public GuestAgentsOperationsImpl( + GuestAgentsOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + private GuestAgentsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadataImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadataImpl.java new file mode 100644 index 0000000000000..61104547687bc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadataImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadata; +import com.azure.resourcemanager.azurestackhci.models.Identity; + +public final class HybridIdentityMetadataImpl implements HybridIdentityMetadata { + private HybridIdentityMetadataInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + HybridIdentityMetadataImpl( + HybridIdentityMetadataInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceUid() { + return this.innerModel().resourceUid(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public HybridIdentityMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasClientImpl.java new file mode 100644 index 0000000000000..764f508fc1d2e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasClientImpl.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurestackhci.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadataList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ +public final class HybridIdentityMetadatasClientImpl implements HybridIdentityMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final HybridIdentityMetadatasService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of HybridIdentityMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HybridIdentityMetadatasClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create(HybridIdentityMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientHybridIdentityMetadatas to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientH") + public interface HybridIdentityMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HybridIdentityMetadataInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), 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())); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * 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 list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasImpl.java new file mode 100644 index 0000000000000..4220582fd36d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadata; +import com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadatas; + +public final class HybridIdentityMetadatasImpl implements HybridIdentityMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadatasImpl.class); + + private final HybridIdentityMetadatasClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public HybridIdentityMetadatasImpl( + HybridIdentityMetadatasClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HybridIdentityMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HybridIdentityMetadata get(String resourceUri) { + HybridIdentityMetadataInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new HybridIdentityMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + } + + private HybridIdentityMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesImpl.java new file mode 100644 index 0000000000000..a2b1def6a4a6b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesImpl.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImages; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import java.util.Collections; +import java.util.Map; + +public final class MarketplaceGalleryImagesImpl + implements MarketplaceGalleryImages, MarketplaceGalleryImages.Definition, MarketplaceGalleryImages.Update { + private MarketplaceGalleryImagesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String containerId() { + return this.innerModel().containerId(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public CloudInitDataSource cloudInitDataSource() { + return this.innerModel().cloudInitDataSource(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public GalleryImageIdentifier identifier() { + return this.innerModel().identifier(); + } + + public GalleryImageVersion version() { + return this.innerModel().version(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public MarketplaceGalleryImageStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MarketplaceGalleryImagesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String marketplaceGalleryImageName; + + private MarketplaceGalleryImagesUpdateRequest updateMarketplaceGalleryImages; + + public MarketplaceGalleryImagesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MarketplaceGalleryImages create() { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .createOrUpdate(resourceGroupName, marketplaceGalleryImageName, this.innerModel(), Context.NONE); + return this; + } + + public MarketplaceGalleryImages create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .createOrUpdate(resourceGroupName, marketplaceGalleryImageName, this.innerModel(), context); + return this; + } + + MarketplaceGalleryImagesImpl( + String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new MarketplaceGalleryImagesInner(); + this.serviceManager = serviceManager; + this.marketplaceGalleryImageName = name; + } + + public MarketplaceGalleryImagesImpl update() { + this.updateMarketplaceGalleryImages = new MarketplaceGalleryImagesUpdateRequest(); + return this; + } + + public MarketplaceGalleryImages apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .update(resourceGroupName, marketplaceGalleryImageName, updateMarketplaceGalleryImages, Context.NONE); + return this; + } + + public MarketplaceGalleryImages apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .update(resourceGroupName, marketplaceGalleryImageName, updateMarketplaceGalleryImages, context); + return this; + } + + MarketplaceGalleryImagesImpl( + MarketplaceGalleryImagesInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.marketplaceGalleryImageName = Utils.getValueFromIdByName(innerObject.id(), "marketplaceGalleryImages"); + } + + public MarketplaceGalleryImages refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, Context.NONE) + .getValue(); + return this; + } + + public MarketplaceGalleryImages refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMarketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, context) + .getValue(); + return this; + } + + public MarketplaceGalleryImagesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MarketplaceGalleryImagesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MarketplaceGalleryImagesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateMarketplaceGalleryImages.withTags(tags); + return this; + } + } + + public MarketplaceGalleryImagesImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public MarketplaceGalleryImagesImpl withContainerId(String containerId) { + this.innerModel().withContainerId(containerId); + return this; + } + + public MarketplaceGalleryImagesImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public MarketplaceGalleryImagesImpl withCloudInitDataSource(CloudInitDataSource cloudInitDataSource) { + this.innerModel().withCloudInitDataSource(cloudInitDataSource); + return this; + } + + public MarketplaceGalleryImagesImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public MarketplaceGalleryImagesImpl withIdentifier(GalleryImageIdentifier identifier) { + this.innerModel().withIdentifier(identifier); + return this; + } + + public MarketplaceGalleryImagesImpl withVersion(GalleryImageVersion version) { + this.innerModel().withVersion(version); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsClientImpl.java similarity index 58% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsClientImpl.java index d04da2f864039..02d13fe695dd3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsClientImpl.java @@ -14,7 +14,6 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -33,155 +32,124 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterList; -import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import com.azure.resourcemanager.azurestackhci.fluent.MarketplaceGalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesListResult; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ClustersClient. */ -public final class ClustersClientImpl implements ClustersClient { +/** + * An instance of this class provides access to all the operations defined in MarketplaceGalleryImagesOperationsClient. + */ +public final class MarketplaceGalleryImagesOperationsClientImpl implements MarketplaceGalleryImagesOperationsClient { /** The proxy service used to perform REST calls. */ - private final ClustersService service; + private final MarketplaceGalleryImagesOperationsService service; /** The service client containing this operation class. */ private final AzureStackHciClientImpl client; /** - * Initializes an instance of ClustersClientImpl. + * Initializes an instance of MarketplaceGalleryImagesOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ClustersClientImpl(AzureStackHciClientImpl client) { - this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + MarketplaceGalleryImagesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + MarketplaceGalleryImagesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureStackHciClientClusters to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureStackHciClientMarketplaceGalleryImagesOperations to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureStackHciClientC") - private interface ClustersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - + @ServiceInterface(name = "AzureStackHciClientM") + public interface MarketplaceGalleryImagesOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages/{marketplaceGalleryImageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterInner cluster, + @BodyParam("application/json") MarketplaceGalleryImagesInner marketplaceGalleryImages, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterPatch cluster, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200, 202, 204}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono>> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/uploadCertificate") - @ExpectedResponses({202}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> uploadCertificate( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UploadCertificateRequest uploadCertificateRequest, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/createClusterIdentity") - @ExpectedResponses({200, 202}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHci/marketplaceGalleryImages") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createIdentity( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -190,7 +158,7 @@ Mono>> createIdentity( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -200,7 +168,7 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listAllNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -208,210 +176,18 @@ Mono> listByResourceGroupNext( } /** - * List all HCI clusters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters 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.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters 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.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all HCI clusters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List all HCI clusters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters 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.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all HCI clusters in a resource group. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a marketplace gallery image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String marketplaceGalleryImageName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -428,120 +204,11 @@ private Mono> listByResourceGroupSinglePageAsync( 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.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { + if (marketplaceGalleryImageName == 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil @@ -552,7 +219,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, context)) @@ -560,19 +227,19 @@ private Mono> getByResourceGroupWithResponseAsync( } /** - * Get HCI cluster. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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 hCI cluster along with {@link Response} on successful completion of {@link Mono}. + * @return a marketplace gallery image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String marketplaceGalleryImageName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -589,8 +256,11 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); @@ -599,74 +269,80 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, context); } /** - * Get HCI cluster. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster on successful completion of {@link Mono}. + * @return a marketplace gallery image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + private Mono getByResourceGroupAsync( + String resourceGroupName, String marketplaceGalleryImageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, marketplaceGalleryImageName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get HCI cluster. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 hCI cluster. + * @return a marketplace gallery image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String marketplaceGalleryImageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, context).block(); } /** - * Get HCI cluster. + * Gets a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return a marketplace gallery image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public MarketplaceGalleryImagesInner getByResourceGroup( + String resourceGroupName, String marketplaceGalleryImageName) { + return getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, Context.NONE).getValue(); } /** - * Create an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + * @return the marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner cluster) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -683,46 +359,56 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + if (marketplaceGalleryImages == null) { + return Mono + .error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); } else { - cluster.validate(); + marketplaceGalleryImages.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .create( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), - cluster, + marketplaceGalleryImages, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 cluster details along with {@link Response} on successful completion of {@link Mono}. + * @return the marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -739,250 +425,246 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + if (marketplaceGalleryImages == null) { + return Mono + .error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); } else { - cluster.validate(); + marketplaceGalleryImages.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), - cluster, + marketplaceGalleryImages, accept, context); } /** - * Create an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of the marketplace gallery image resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createAsync(resourceGroupName, clusterName, cluster).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceGalleryImagesInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MarketplaceGalleryImagesInner.class, + MarketplaceGalleryImagesInner.class, + this.client.getContext()); } /** - * Create an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 cluster details along with {@link Response}. + * @return the {@link PollerFlux} for polling of the marketplace gallery image resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceGalleryImagesInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MarketplaceGalleryImagesInner.class, + MarketplaceGalleryImagesInner.class, + context); } /** - * Update an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterPatch cluster) { - 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); - } else { - cluster.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - this.client.getApiVersion(), - cluster, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages) + .getSyncPoller(); } /** - * Update an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 cluster details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 marketplace gallery image resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterPatch cluster, 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); - } else { - cluster.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - this.client.getApiVersion(), - cluster, - accept, - context); + private Mono createOrUpdateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { + return beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @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 cluster details on successful completion of {@link Mono}. + * @return the marketplace gallery image resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, ClusterPatch cluster) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { - return updateAsync(resourceGroupName, clusterName, cluster).block(); + public MarketplaceGalleryImagesInner createOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { + return createOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).block(); } /** - * Update an HCI cluster. + * The operation to create or update a marketplace gallery image. Please note some properties can be set only during + * marketplace gallery image creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource definition. * @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 cluster details along with {@link Response}. + * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public MarketplaceGalleryImagesInner createOrUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, + Context context) { + return createOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .block(); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 clusterName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String marketplaceGalleryImageName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -999,8 +681,11 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil @@ -1011,7 +696,7 @@ private Mono>> deleteWithResponseAsync(String resource this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, context)) @@ -1019,10 +704,10 @@ private Mono>> deleteWithResponseAsync(String resource } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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. @@ -1031,7 +716,7 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + String resourceGroupName, String marketplaceGalleryImageName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1048,8 +733,11 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1058,25 +746,26 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, context); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String marketplaceGalleryImageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, marketplaceGalleryImageName); return this .client .getLroResult( @@ -1084,10 +773,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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. @@ -1096,34 +785,36 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, Context context) { + String resourceGroupName, String marketplaceGalleryImageName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + public SyncPoller, Void> beginDelete( + String resourceGroupName, String marketplaceGalleryImageName) { + return this.beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName).getSyncPoller(); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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. @@ -1132,30 +823,32 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + String resourceGroupName, String marketplaceGalleryImageName, Context context) { + return this.beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName, context).getSyncPoller(); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String marketplaceGalleryImageName) { + return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @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. @@ -1163,55 +856,58 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context) + private Mono deleteAsync(String resourceGroupName, String marketplaceGalleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + public void delete(String resourceGroupName, String marketplaceGalleryImageName) { + deleteAsync(resourceGroupName, marketplaceGalleryImageName).block(); } /** - * Delete an HCI cluster. + * The operation to delete a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + public void delete(String resourceGroupName, String marketplaceGalleryImageName, Context context) { + deleteAsync(resourceGroupName, marketplaceGalleryImageName, context).block(); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> uploadCertificateWithResponseAsync( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1228,50 +924,54 @@ private Mono>> uploadCertificateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } - if (uploadCertificateRequest == null) { + if (marketplaceGalleryImages == null) { return Mono .error( - new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); } else { - uploadCertificateRequest.validate(); + marketplaceGalleryImages.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .uploadCertificate( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), - uploadCertificateRequest, + marketplaceGalleryImages, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @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}. + * @return the marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> uploadCertificateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1289,208 +989,233 @@ private Mono>> uploadCertificateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (marketplaceGalleryImageName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter marketplaceGalleryImageName is required and cannot be null.")); } - if (uploadCertificateRequest == null) { + if (marketplaceGalleryImages == null) { return Mono .error( - new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); } else { - uploadCertificateRequest.validate(); + marketplaceGalleryImages.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .uploadCertificate( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + marketplaceGalleryImageName, this.client.getApiVersion(), - uploadCertificateRequest, + marketplaceGalleryImages, accept, context); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUploadCertificateAsync( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { Mono>> mono = - uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest); + updateWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + .getLroResult( + mono, + this.client.getHttpPipeline(), + MarketplaceGalleryImagesInner.class, + MarketplaceGalleryImagesInner.class, + this.client.getContext()); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUploadCertificateAsync( + private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { context = this.client.mergeContext(context); Mono>> mono = - uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest, context); + updateWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, + this.client.getHttpPipeline(), + MarketplaceGalleryImagesInner.class, + MarketplaceGalleryImagesInner.class, + context); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).getSyncPoller(); + public SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return this + .beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages) + .getSyncPoller(); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUploadCertificate( + public SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + return this + .beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) .getSyncPoller(); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the marketplace gallery image resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono uploadCertificateAsync( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest) + private Mono updateAsync( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the marketplace gallery image resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono uploadCertificateAsync( + private Mono updateAsync( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + return beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { - uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).block(); + public MarketplaceGalleryImagesInner update( + String resourceGroupName, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return updateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).block(); } /** - * Upload certificate. + * The operation to update a marketplace gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param marketplaceGalleryImages The marketplace gallery image resource patch definition. * @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 marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadCertificate( + public MarketplaceGalleryImagesInner update( String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, + String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { - uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context).block(); + return updateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context).block(); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createIdentityWithResponseAsync( - String resourceGroupName, String clusterName) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1507,39 +1232,44 @@ private Mono>> createIdentityWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createIdentity( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), 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())); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createIdentityWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1556,184 +1286,251 @@ private Mono>> createIdentityWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createIdentity( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of cluster Identity details. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( - String resourceGroupName, String clusterName) { - Mono>> mono = createIdentityWithResponseAsync(resourceGroupName, clusterName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ClusterIdentityResponseInner.class, - ClusterIdentityResponseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of cluster Identity details. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( - String resourceGroupName, String clusterName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createIdentityWithResponseAsync(resourceGroupName, clusterName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ClusterIdentityResponseInner.class, - ClusterIdentityResponseInner.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( - String resourceGroupName, String clusterName, Context context) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster Identity details on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIdentityAsync(String resourceGroupName, String clusterName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + 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.getSubscriptionId(), + this.client.getApiVersion(), + 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())); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 cluster Identity details on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIdentityAsync( - String resourceGroupName, String clusterName, Context context) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @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 cluster Identity details. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName) { - return createIdentityAsync(resourceGroupName, clusterName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); } /** - * Create cluster identity. + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context) { - return createIdentityAsync(resourceGroupName, clusterName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1745,9 +1542,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1762,15 +1558,17 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1783,7 +1581,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1798,14 +1596,15 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listAllNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1817,9 +1616,8 @@ private Mono> listByResourceGroupNextSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1834,15 +1632,17 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAllNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1855,7 +1655,7 @@ private Mono> listByResourceGroupNextSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .listAllNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsImpl.java new file mode 100644 index 0000000000000..895590ed08068 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.MarketplaceGalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImages; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesOperations; + +public final class MarketplaceGalleryImagesOperationsImpl implements MarketplaceGalleryImagesOperations { + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceGalleryImagesOperationsImpl.class); + + private final MarketplaceGalleryImagesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public MarketplaceGalleryImagesOperationsImpl( + MarketplaceGalleryImagesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String marketplaceGalleryImageName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MarketplaceGalleryImagesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MarketplaceGalleryImages getByResourceGroup(String resourceGroupName, String marketplaceGalleryImageName) { + MarketplaceGalleryImagesInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, marketplaceGalleryImageName); + if (inner != null) { + return new MarketplaceGalleryImagesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String marketplaceGalleryImageName) { + this.serviceClient().delete(resourceGroupName, marketplaceGalleryImageName); + } + + public void delete(String resourceGroupName, String marketplaceGalleryImageName, Context context) { + this.serviceClient().delete(resourceGroupName, marketplaceGalleryImageName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public MarketplaceGalleryImages 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 marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + if (marketplaceGalleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, 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 marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + if (marketplaceGalleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, 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 marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + if (marketplaceGalleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", + id))); + } + this.delete(resourceGroupName, marketplaceGalleryImageName, Context.NONE); + } + + public void 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 marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + if (marketplaceGalleryImageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", + id))); + } + this.delete(resourceGroupName, marketplaceGalleryImageName, context); + } + + private MarketplaceGalleryImagesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public MarketplaceGalleryImagesImpl define(String name) { + return new MarketplaceGalleryImagesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesImpl.java new file mode 100644 index 0000000000000..3d4a8fab6f371 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaceStatus; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaces; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkInterfacesImpl + implements NetworkInterfaces, NetworkInterfaces.Definition, NetworkInterfaces.Update { + private NetworkInterfacesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String macAddress() { + return this.innerModel().macAddress(); + } + + public InterfaceDnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkInterfacesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkInterfaceName; + + private NetworkInterfacesUpdateRequest updateNetworkInterfaces; + + public NetworkInterfacesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkInterfaces create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterfaces create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), context); + return this; + } + + NetworkInterfacesImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new NetworkInterfacesInner(); + this.serviceManager = serviceManager; + this.networkInterfaceName = name; + } + + public NetworkInterfacesImpl update() { + this.updateNetworkInterfaces = new NetworkInterfacesUpdateRequest(); + return this; + } + + public NetworkInterfaces apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .update(resourceGroupName, networkInterfaceName, updateNetworkInterfaces, Context.NONE); + return this; + } + + public NetworkInterfaces apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .update(resourceGroupName, networkInterfaceName, updateNetworkInterfaces, context); + return this; + } + + NetworkInterfacesImpl( + NetworkInterfacesInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + } + + public NetworkInterfaces refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterfaces refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfacesOperations() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, context) + .getValue(); + return this; + } + + public NetworkInterfacesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkInterfacesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkInterfacesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateNetworkInterfaces.withTags(tags); + return this; + } + } + + public NetworkInterfacesImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public NetworkInterfacesImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public NetworkInterfacesImpl withMacAddress(String macAddress) { + this.innerModel().withMacAddress(macAddress); + return this; + } + + public NetworkInterfacesImpl withDnsSettings(InterfaceDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsClientImpl.java new file mode 100644 index 0000000000000..fe1c145dbf7a4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsClientImpl.java @@ -0,0 +1,1611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.NetworkInterfacesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesListResult; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkInterfacesOperationsClient. */ +public final class NetworkInterfacesOperationsClientImpl implements NetworkInterfacesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkInterfacesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfacesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfacesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientNetworkInterfacesOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientN") + public interface NetworkInterfacesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkInterfacesInner networkInterfaces, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkInterfacesUpdateRequest networkInterfaces, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkInterfaceName) { + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 network interface along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkInterfaceName, 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 network interface along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, context).block(); + } + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfacesInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, Context.NONE).getValue(); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (networkInterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaces is required and cannot be null.")); + } else { + networkInterfaces.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + networkInterfaces, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @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 network interface resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (networkInterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaces is required and cannot be null.")); + } else { + networkInterfaces.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + networkInterfaces, + accept, + context); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfacesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfacesInner.class, + NetworkInterfacesInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfacesInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfacesInner.class, + NetworkInterfacesInner.class, + context); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces) + .getSyncPoller(); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @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 network interface resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfacesInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { + return createOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).block(); + } + + /** + * The operation to create or update a network interface. Please note some properties can be set only during network + * interface creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource definition. + * @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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfacesInner createOrUpdate( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context).block(); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkInterfaceName) { + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 networkInterfaceName, 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName 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, + networkInterfaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkInterfaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkInterfaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName) { + return this.beginDeleteAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkInterfaceName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkInterfaceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkInterfaceName) { + deleteAsync(resourceGroupName, networkInterfaceName).block(); + } + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkInterfaceName, Context context) { + deleteAsync(resourceGroupName, networkInterfaceName, context).block(); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (networkInterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaces is required and cannot be null.")); + } else { + networkInterfaces.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + networkInterfaces, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @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 network interface resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + 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 (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (networkInterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaces is required and cannot be null.")); + } else { + networkInterfaces.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkInterfaceName, + this.client.getApiVersion(), + networkInterfaces, + accept, + context); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfacesInner> beginUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfacesInner.class, + NetworkInterfacesInner.class, + this.client.getContext()); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfacesInner> beginUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfacesInner.class, + NetworkInterfacesInner.class, + context); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfacesInner> beginUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { + return this.beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).getSyncPoller(); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfacesInner> beginUpdate( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) + .getSyncPoller(); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { + return beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @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 network interface resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context) { + return beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfacesInner update( + String resourceGroupName, String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { + return updateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).block(); + } + + /** + * The operation to update a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param networkInterfaces The network interface resource patch definition. + * @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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfacesInner update( + String resourceGroupName, + String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, + Context context) { + return updateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context).block(); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @throws 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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsImpl.java new file mode 100644 index 0000000000000..b84e1939d5239 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.NetworkInterfacesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaces; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesOperations; + +public final class NetworkInterfacesOperationsImpl implements NetworkInterfacesOperations { + private static final ClientLogger LOGGER = new ClientLogger(NetworkInterfacesOperationsImpl.class); + + private final NetworkInterfacesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public NetworkInterfacesOperationsImpl( + NetworkInterfacesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfacesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkInterfaces getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfacesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkInterfaceName) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName); + } + + public void delete(String resourceGroupName, String networkInterfaceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public NetworkInterfaces 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, Context.NONE); + } + + public void 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, context); + } + + private NetworkInterfacesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public NetworkInterfacesImpl define(String name) { + return new NetworkInterfacesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java deleted file mode 100644 index 5d406ea17f054..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java +++ /dev/null @@ -1,45 +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.azurestackhci.implementation; - -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.azurestackhci.models.Operation; -import com.azure.resourcemanager.azurestackhci.models.OperationListResult; -import java.util.Collections; -import java.util.List; - -public final class OperationListResultImpl implements OperationListResult { - private OperationListResultInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - OperationListResultImpl( - OperationListResultInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public OperationListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java deleted file mode 100644 index 1e22db58c5969..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,148 +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.azurestackhci.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final AzureStackHciClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(AzureStackHciClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureStackHciClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureStackHciClientO") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.AzureStackHCI/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @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 REST API operations supported by an Azure Resource Provider along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); - } - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @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 REST API operations supported by an Azure Resource Provider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java deleted file mode 100644 index 9a5400b784a4d..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java +++ /dev/null @@ -1,58 +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.azurestackhci.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.azurestackhci.models.OperationListResult; -import com.azure.resourcemanager.azurestackhci.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java deleted file mode 100644 index 281ace205dd39..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.implementation; - -import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; -import java.time.OffsetDateTime; - -public final class PasswordCredentialImpl implements PasswordCredential { - private PasswordCredentialInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - PasswordCredentialImpl( - PasswordCredentialInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String secretText() { - return this.innerModel().secretText(); - } - - public String keyId() { - return this.innerModel().keyId(); - } - - public OffsetDateTime startDateTime() { - return this.innerModel().startDateTime(); - } - - public OffsetDateTime endDateTime() { - return this.innerModel().endDateTime(); - } - - public PasswordCredentialInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersImpl.java new file mode 100644 index 0000000000000..abd5a3f5b3ac7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus; +import com.azure.resourcemanager.azurestackhci.models.StorageContainers; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest; +import java.util.Collections; +import java.util.Map; + +public final class StorageContainersImpl + implements StorageContainers, StorageContainers.Definition, StorageContainers.Update { + private StorageContainersInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String path() { + return this.innerModel().path(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public StorageContainerStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageContainersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageContainerName; + + private StorageContainersUpdateRequest updateStorageContainers; + + public StorageContainersImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageContainers create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .createOrUpdate(resourceGroupName, storageContainerName, this.innerModel(), Context.NONE); + return this; + } + + public StorageContainers create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .createOrUpdate(resourceGroupName, storageContainerName, this.innerModel(), context); + return this; + } + + StorageContainersImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new StorageContainersInner(); + this.serviceManager = serviceManager; + this.storageContainerName = name; + } + + public StorageContainersImpl update() { + this.updateStorageContainers = new StorageContainersUpdateRequest(); + return this; + } + + public StorageContainers apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .update(resourceGroupName, storageContainerName, updateStorageContainers, Context.NONE); + return this; + } + + public StorageContainers apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .update(resourceGroupName, storageContainerName, updateStorageContainers, context); + return this; + } + + StorageContainersImpl( + StorageContainersInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageContainerName = Utils.getValueFromIdByName(innerObject.id(), "storageContainers"); + } + + public StorageContainers refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .getByResourceGroupWithResponse(resourceGroupName, storageContainerName, Context.NONE) + .getValue(); + return this; + } + + public StorageContainers refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageContainersOperations() + .getByResourceGroupWithResponse(resourceGroupName, storageContainerName, context) + .getValue(); + return this; + } + + public StorageContainersImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public StorageContainersImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public StorageContainersImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateStorageContainers.withTags(tags); + return this; + } + } + + public StorageContainersImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public StorageContainersImpl withPath(String path) { + this.innerModel().withPath(path); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsClientImpl.java new file mode 100644 index 0000000000000..85dbc68d1d3f5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsClientImpl.java @@ -0,0 +1,1611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.StorageContainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersListResult; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StorageContainersOperationsClient. */ +public final class StorageContainersOperationsClientImpl implements StorageContainersOperationsClient { + /** The proxy service used to perform REST calls. */ + private final StorageContainersOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of StorageContainersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageContainersOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + StorageContainersOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientStorageContainersOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + public interface StorageContainersOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/storageContainers/{storageContainerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageContainerName") String storageContainerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/storageContainers/{storageContainerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageContainerName") String storageContainerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageContainersInner storageContainers, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/storageContainers/{storageContainerName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageContainerName") String storageContainerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/storageContainers/{storageContainerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageContainerName") String storageContainerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageContainersUpdateRequest storageContainers, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/storageContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHci/storageContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageContainerName) { + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageContainerName, 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String storageContainerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageContainerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storageContainerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageContainerName, context).block(); + } + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainersInner getByResourceGroup(String resourceGroupName, String storageContainerName) { + return getByResourceGroupWithResponse(resourceGroupName, storageContainerName, Context.NONE).getValue(); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + if (storageContainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainers is required and cannot be null.")); + } else { + storageContainers.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + storageContainers, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @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 storage container resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + if (storageContainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainers is required and cannot be null.")); + } else { + storageContainers.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + storageContainers, + accept, + context); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageContainersInner> beginCreateOrUpdateAsync( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageContainersInner.class, + StorageContainersInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageContainersInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageContainersInner.class, + StorageContainersInner.class, + context); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageContainersInner> beginCreateOrUpdate( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers) + .getSyncPoller(); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageContainersInner> beginCreateOrUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { + return beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @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 storage container resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainersInner createOrUpdate( + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { + return createOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers).block(); + } + + /** + * The operation to create or update a storage container. Please note some properties can be set only during storage + * container creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainersInner createOrUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersInner storageContainers, + Context context) { + return createOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context).block(); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storageContainerName) { + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storageContainerName, 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName 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, + storageContainerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageContainerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageContainerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageContainerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageContainerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String storageContainerName) { + return this.beginDeleteAsync(resourceGroupName, storageContainerName).getSyncPoller(); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageContainerName, Context context) { + return this.beginDeleteAsync(resourceGroupName, storageContainerName, context).getSyncPoller(); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storageContainerName) { + return beginDeleteAsync(resourceGroupName, storageContainerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageContainerName, Context context) { + return beginDeleteAsync(resourceGroupName, storageContainerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 storageContainerName) { + deleteAsync(resourceGroupName, storageContainerName).block(); + } + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String storageContainerName, Context context) { + deleteAsync(resourceGroupName, storageContainerName, context).block(); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers) { + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + if (storageContainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainers is required and cannot be null.")); + } else { + storageContainers.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + storageContainers, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @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 storage container resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + 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 (storageContainerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainerName is required and cannot be null.")); + } + if (storageContainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageContainers is required and cannot be null.")); + } else { + storageContainers.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageContainerName, + this.client.getApiVersion(), + storageContainers, + accept, + context); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageContainersInner> beginUpdateAsync( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageContainersInner.class, + StorageContainersInner.class, + this.client.getContext()); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageContainersInner> beginUpdateAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageContainersInner.class, + StorageContainersInner.class, + context); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageContainersInner> beginUpdate( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers) { + return this.beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers).getSyncPoller(); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageContainersInner> beginUpdate( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) + .getSyncPoller(); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers) { + return beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @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 storage container resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context) { + return beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainersInner update( + String resourceGroupName, String storageContainerName, StorageContainersUpdateRequest storageContainers) { + return updateAsync(resourceGroupName, storageContainerName, storageContainers).block(); + } + + /** + * The operation to update a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param storageContainers The storage container resource patch definition. + * @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 storage container resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainersInner update( + String resourceGroupName, + String storageContainerName, + StorageContainersUpdateRequest storageContainers, + Context context) { + return updateAsync(resourceGroupName, storageContainerName, storageContainers, context).block(); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @throws 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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsImpl.java new file mode 100644 index 0000000000000..307033ff61132 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.StorageContainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import com.azure.resourcemanager.azurestackhci.models.StorageContainers; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersOperations; + +public final class StorageContainersOperationsImpl implements StorageContainersOperations { + private static final ClientLogger LOGGER = new ClientLogger(StorageContainersOperationsImpl.class); + + private final StorageContainersOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public StorageContainersOperationsImpl( + StorageContainersOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storageContainerName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storageContainerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageContainersImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageContainers getByResourceGroup(String resourceGroupName, String storageContainerName) { + StorageContainersInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, storageContainerName); + if (inner != null) { + return new StorageContainersImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String storageContainerName) { + this.serviceClient().delete(resourceGroupName, storageContainerName); + } + + public void delete(String resourceGroupName, String storageContainerName, Context context) { + this.serviceClient().delete(resourceGroupName, storageContainerName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public StorageContainers 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 storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + if (storageContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageContainerName, 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 storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + if (storageContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageContainerName, 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 storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + if (storageContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); + } + this.delete(resourceGroupName, storageContainerName, Context.NONE); + } + + public void 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 storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + if (storageContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); + } + this.delete(resourceGroupName, storageContainerName, context); + } + + private StorageContainersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public StorageContainersImpl define(String name) { + return new StorageContainersImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java new file mode 100644 index 0000000000000..820dbfdfc0bb2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import com.azure.resourcemanager.azurestackhci.models.DiskFileFormat; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatus; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest; +import java.util.Collections; +import java.util.Map; + +public final class VirtualHardDisksImpl + implements VirtualHardDisks, VirtualHardDisks.Definition, VirtualHardDisks.Update { + private VirtualHardDisksInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Integer blockSizeBytes() { + return this.innerModel().blockSizeBytes(); + } + + public Long diskSizeGB() { + return this.innerModel().diskSizeGB(); + } + + public Boolean dynamic() { + return this.innerModel().dynamic(); + } + + public Integer logicalSectorBytes() { + return this.innerModel().logicalSectorBytes(); + } + + public Integer physicalSectorBytes() { + return this.innerModel().physicalSectorBytes(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public DiskFileFormat diskFileFormat() { + return this.innerModel().diskFileFormat(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public String containerId() { + return this.innerModel().containerId(); + } + + public VirtualHardDiskStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualHardDisksInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHardDiskName; + + private VirtualHardDisksUpdateRequest updateVirtualHardDisks; + + public VirtualHardDisksImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualHardDisks create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .createOrUpdate(resourceGroupName, virtualHardDiskName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualHardDisks create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .createOrUpdate(resourceGroupName, virtualHardDiskName, this.innerModel(), context); + return this; + } + + VirtualHardDisksImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new VirtualHardDisksInner(); + this.serviceManager = serviceManager; + this.virtualHardDiskName = name; + } + + public VirtualHardDisksImpl update() { + this.updateVirtualHardDisks = new VirtualHardDisksUpdateRequest(); + return this; + } + + public VirtualHardDisks apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .update(resourceGroupName, virtualHardDiskName, updateVirtualHardDisks, Context.NONE); + return this; + } + + public VirtualHardDisks apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .update(resourceGroupName, virtualHardDiskName, updateVirtualHardDisks, context); + return this; + } + + VirtualHardDisksImpl( + VirtualHardDisksInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHardDiskName = Utils.getValueFromIdByName(innerObject.id(), "virtualHardDisks"); + } + + public VirtualHardDisks refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, Context.NONE) + .getValue(); + return this; + } + + public VirtualHardDisks refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHardDisksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, context) + .getValue(); + return this; + } + + public VirtualHardDisksImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualHardDisksImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualHardDisksImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualHardDisks.withTags(tags); + return this; + } + } + + public VirtualHardDisksImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualHardDisksImpl withBlockSizeBytes(Integer blockSizeBytes) { + this.innerModel().withBlockSizeBytes(blockSizeBytes); + return this; + } + + public VirtualHardDisksImpl withDiskSizeGB(Long diskSizeGB) { + this.innerModel().withDiskSizeGB(diskSizeGB); + return this; + } + + public VirtualHardDisksImpl withDynamic(Boolean dynamic) { + this.innerModel().withDynamic(dynamic); + return this; + } + + public VirtualHardDisksImpl withLogicalSectorBytes(Integer logicalSectorBytes) { + this.innerModel().withLogicalSectorBytes(logicalSectorBytes); + return this; + } + + public VirtualHardDisksImpl withPhysicalSectorBytes(Integer physicalSectorBytes) { + this.innerModel().withPhysicalSectorBytes(physicalSectorBytes); + return this; + } + + public VirtualHardDisksImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public VirtualHardDisksImpl withDiskFileFormat(DiskFileFormat diskFileFormat) { + this.innerModel().withDiskFileFormat(diskFileFormat); + return this; + } + + public VirtualHardDisksImpl withContainerId(String containerId) { + this.innerModel().withContainerId(containerId); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsClientImpl.java new file mode 100644 index 0000000000000..14c6bb84365c8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsClientImpl.java @@ -0,0 +1,1583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualHardDisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHardDisksOperationsClient. */ +public final class VirtualHardDisksOperationsClientImpl implements VirtualHardDisksOperationsClient { + /** The proxy service used to perform REST calls. */ + private final VirtualHardDisksOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of VirtualHardDisksOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHardDisksOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + VirtualHardDisksOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientVirtualHardDisksOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientV") + public interface VirtualHardDisksOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/virtualHardDisks/{virtualHardDiskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHardDiskName") String virtualHardDiskName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/virtualHardDisks/{virtualHardDiskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHardDiskName") String virtualHardDiskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHardDisksInner virtualHardDisks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/virtualHardDisks/{virtualHardDiskName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHardDiskName") String virtualHardDiskName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/virtualHardDisks/{virtualHardDiskName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHardDiskName") String virtualHardDiskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHardDisksUpdateRequest virtualHardDisks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/virtualHardDisks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHci/virtualHardDisks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualHardDiskName) { + 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @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 virtual hard disk along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualHardDiskName, 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualHardDiskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHardDiskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @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 virtual hard disk along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHardDiskName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHardDiskName, context).block(); + } + + /** + * Gets a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHardDisksInner getByResourceGroup(String resourceGroupName, String virtualHardDiskName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, Context.NONE).getValue(); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks) { + 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + if (virtualHardDisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDisks is required and cannot be null.")); + } else { + virtualHardDisks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + virtualHardDisks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @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 virtual hard disk resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + if (virtualHardDisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDisks is required and cannot be null.")); + } else { + virtualHardDisks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + virtualHardDisks, + accept, + context); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHardDisksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualHardDisksInner.class, + VirtualHardDisksInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHardDisksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, context); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).getSyncPoller(); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @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 virtual hard disk resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHardDisksInner createOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks) { + return createOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).block(); + } + + /** + * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual + * hard disk creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource definition. + * @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 virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHardDisksInner createOrUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).block(); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtualHardDiskName) { + 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @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 virtualHardDiskName, 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName 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, + virtualHardDiskName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHardDiskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualHardDiskName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String virtualHardDiskName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHardDiskName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHardDiskName) { + return this.beginDeleteAsync(resourceGroupName, virtualHardDiskName).getSyncPoller(); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHardDiskName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualHardDiskName, context).getSyncPoller(); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtualHardDiskName) { + return beginDeleteAsync(resourceGroupName, virtualHardDiskName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualHardDiskName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHardDiskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHardDiskName) { + deleteAsync(resourceGroupName, virtualHardDiskName).block(); + } + + /** + * The operation to delete a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualHardDiskName, Context context) { + deleteAsync(resourceGroupName, virtualHardDiskName, context).block(); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { + 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + if (virtualHardDisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDisks is required and cannot be null.")); + } else { + virtualHardDisks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + virtualHardDisks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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 virtual hard disk resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, + 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 (virtualHardDiskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDiskName is required and cannot be null.")); + } + if (virtualHardDisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHardDisks is required and cannot be null.")); + } else { + virtualHardDisks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHardDiskName, + this.client.getApiVersion(), + virtualHardDisks, + accept, + context); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHardDisksInner> beginUpdateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualHardDisksInner.class, + VirtualHardDisksInner.class, + this.client.getContext()); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHardDisksInner> beginUpdateAsync( + String resourceGroupName, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, context); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHardDisksInner> beginUpdate( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { + return this.beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).getSyncPoller(); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHardDisksInner> beginUpdate( + String resourceGroupName, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, + Context context) { + return this.beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).getSyncPoller(); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { + return beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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 virtual hard disk resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, + Context context) { + return beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHardDisksInner update( + String resourceGroupName, String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { + return updateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).block(); + } + + /** + * The operation to update a virtual hard disk. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. + * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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 virtual hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHardDisksInner update( + String resourceGroupName, + String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, + Context context) { + return updateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).block(); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @throws 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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @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 body 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsImpl.java new file mode 100644 index 0000000000000..a660010a41c3d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualHardDisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksOperations; + +public final class VirtualHardDisksOperationsImpl implements VirtualHardDisksOperations { + private static final ClientLogger LOGGER = new ClientLogger(VirtualHardDisksOperationsImpl.class); + + private final VirtualHardDisksOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualHardDisksOperationsImpl( + VirtualHardDisksOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHardDiskName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualHardDisksImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualHardDisks getByResourceGroup(String resourceGroupName, String virtualHardDiskName) { + VirtualHardDisksInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualHardDiskName); + if (inner != null) { + return new VirtualHardDisksImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualHardDiskName) { + this.serviceClient().delete(resourceGroupName, virtualHardDiskName); + } + + public void delete(String resourceGroupName, String virtualHardDiskName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHardDiskName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public VirtualHardDisks 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 virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + if (virtualHardDiskName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, 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 virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + if (virtualHardDiskName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, 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 virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + if (virtualHardDiskName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); + } + this.delete(resourceGroupName, virtualHardDiskName, Context.NONE); + } + + public void 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 virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + if (virtualHardDiskName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); + } + this.delete(resourceGroupName, virtualHardDiskName, context); + } + + private VirtualHardDisksOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public VirtualHardDisksImpl define(String name) { + return new VirtualHardDisksImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstanceImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstanceImpl.java new file mode 100644 index 0000000000000..c6a541e0ceef0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstanceImpl.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstance; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView; + +public final class VirtualMachineInstanceImpl implements VirtualMachineInstance { + private VirtualMachineInstanceInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + VirtualMachineInstanceImpl( + VirtualMachineInstanceInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualMachineInstancePropertiesHardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public VirtualMachineInstancePropertiesNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public VirtualMachineInstancePropertiesOsProfile osProfile() { + return this.innerModel().osProfile(); + } + + public VirtualMachineInstancePropertiesSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public VirtualMachineInstancePropertiesStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public VirtualMachineInstanceStatus status() { + return this.innerModel().status(); + } + + public GuestAgentInstallStatus guestAgentInstallStatus() { + return this.innerModel().guestAgentInstallStatus(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String resourceUid() { + return this.innerModel().resourceUid(); + } + + public VirtualMachineInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesClientImpl.java new file mode 100644 index 0000000000000..54f23057bd480 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesClientImpl.java @@ -0,0 +1,1794 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineInstancesClient. */ +public final class VirtualMachineInstancesClientImpl implements VirtualMachineInstancesClient { + /** The proxy service used to perform REST calls. */ + private final VirtualMachineInstancesService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of VirtualMachineInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineInstancesClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create(VirtualMachineInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientVirtualMachineInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientV") + public interface VirtualMachineInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualMachineInstanceInner virtualMachineInstance, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualMachineInstanceUpdateRequest virtualMachineInstance, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (virtualMachineInstance == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineInstance is required and cannot be null.")); + } else { + virtualMachineInstance.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + virtualMachineInstance, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (virtualMachineInstance == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineInstance is required and cannot be null.")); + } else { + virtualMachineInstance.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + virtualMachineInstance, + accept, + context); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginCreateOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, virtualMachineInstance); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginCreateOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceUri, virtualMachineInstance, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + return this.beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + return this.beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance, context).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + return beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + return beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + return createOrUpdateAsync(resourceUri, virtualMachineInstance).block(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + return createOrUpdateAsync(resourceUri, virtualMachineInstance, context).block(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + Mono>> mono = deleteWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri) { + return this.beginDeleteAsync(resourceUri).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri, Context context) { + return this.beginDeleteAsync(resourceUri, context).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + return beginDeleteAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Context context) { + return beginDeleteAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + deleteAsync(resourceUri).block(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, Context context) { + deleteAsync(resourceUri, context).block(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (virtualMachineInstance == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineInstance is required and cannot be null.")); + } else { + virtualMachineInstance.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + virtualMachineInstance, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (virtualMachineInstance == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineInstance is required and cannot be null.")); + } else { + virtualMachineInstance.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + virtualMachineInstance, + accept, + context); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginUpdateAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + Mono>> mono = updateWithResponseAsync(resourceUri, virtualMachineInstance); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginUpdateAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceUri, virtualMachineInstance, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + return this.beginUpdateAsync(resourceUri, virtualMachineInstance).getSyncPoller(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + return this.beginUpdateAsync(resourceUri, virtualMachineInstance, context).getSyncPoller(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + return beginUpdateAsync(resourceUri, virtualMachineInstance) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + return beginUpdateAsync(resourceUri, virtualMachineInstance, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + return updateAsync(resourceUri, virtualMachineInstance).block(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + return updateAsync(resourceUri, virtualMachineInstance, context).block(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.start(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginStartAsync( + String resourceUri) { + Mono>> mono = startWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginStartAsync( + String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginStart( + String resourceUri) { + return this.beginStartAsync(resourceUri).getSyncPoller(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginStart( + String resourceUri, Context context) { + return this.beginStartAsync(resourceUri, context).getSyncPoller(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri) { + return beginStartAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri, Context context) { + return beginStartAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner start(String resourceUri) { + return startAsync(resourceUri).block(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner start(String resourceUri, Context context) { + return startAsync(resourceUri, context).block(); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.stop(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginStopAsync( + String resourceUri) { + Mono>> mono = stopWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginStopAsync( + String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginStop( + String resourceUri) { + return this.beginStopAsync(resourceUri).getSyncPoller(); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginStop( + String resourceUri, Context context) { + return this.beginStopAsync(resourceUri, context).getSyncPoller(); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri) { + return beginStopAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri, Context context) { + return beginStopAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner stop(String resourceUri) { + return stopAsync(resourceUri).block(); + } + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner stop(String resourceUri, Context context) { + return stopAsync(resourceUri, context).block(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginRestartAsync( + String resourceUri) { + Mono>> mono = restartWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginRestartAsync( + String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginRestart( + String resourceUri) { + return this.beginRestartAsync(resourceUri).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginRestart( + String resourceUri, Context context) { + return this.beginRestartAsync(resourceUri, context).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceUri) { + return beginRestartAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceUri, Context context) { + return beginRestartAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner restart(String resourceUri) { + return restartAsync(resourceUri).block(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner restart(String resourceUri, Context context) { + return restartAsync(resourceUri, context).block(); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), 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())); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesImpl.java new file mode 100644 index 0000000000000..ff59ab561cfa3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstance; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstances; + +public final class VirtualMachineInstancesImpl implements VirtualMachineInstances { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstancesImpl.class); + + private final VirtualMachineInstancesClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualMachineInstancesImpl( + VirtualMachineInstancesClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineInstance get(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri, virtualMachineInstance); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + VirtualMachineInstanceInner inner = + this.serviceClient().createOrUpdate(resourceUri, virtualMachineInstance, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Context context) { + this.serviceClient().delete(resourceUri, context); + } + + public VirtualMachineInstance update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, virtualMachineInstance); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, virtualMachineInstance, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance start(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().start(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance start(String resourceUri, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().start(resourceUri, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance stop(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().stop(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance stop(String resourceUri, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().stop(resourceUri, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance restart(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().restart(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance restart(String resourceUri, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().restart(resourceUri, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + private VirtualMachineInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..34772af59096c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.NetworkTypeEnum; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkPropertiesSubnetsItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworkStatus; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksUpdateRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualNetworksImpl implements VirtualNetworks, VirtualNetworks.Definition, VirtualNetworks.Update { + private VirtualNetworksInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualNetworkPropertiesDhcpOptions dhcpOptions() { + return this.innerModel().dhcpOptions(); + } + + public NetworkTypeEnum networkType() { + return this.innerModel().networkType(); + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public String vmSwitchName() { + return this.innerModel().vmSwitchName(); + } + + public VirtualNetworkStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualNetworksInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private VirtualNetworksUpdateRequest updateVirtualNetworks; + + public VirtualNetworksImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworks create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworks create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), context); + return this; + } + + VirtualNetworksImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new VirtualNetworksInner(); + this.serviceManager = serviceManager; + this.virtualNetworkName = name; + } + + public VirtualNetworksImpl update() { + this.updateVirtualNetworks = new VirtualNetworksUpdateRequest(); + return this; + } + + public VirtualNetworks apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .update(resourceGroupName, virtualNetworkName, updateVirtualNetworks, Context.NONE); + return this; + } + + public VirtualNetworks apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .update(resourceGroupName, virtualNetworkName, updateVirtualNetworks, context); + return this; + } + + VirtualNetworksImpl( + VirtualNetworksInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + } + + public VirtualNetworks refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworks refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context) + .getValue(); + return this; + } + + public VirtualNetworksImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworksImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworksImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualNetworks.withTags(tags); + return this; + } + } + + public VirtualNetworksImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualNetworksImpl withDhcpOptions(VirtualNetworkPropertiesDhcpOptions dhcpOptions) { + this.innerModel().withDhcpOptions(dhcpOptions); + return this; + } + + public VirtualNetworksImpl withNetworkType(NetworkTypeEnum networkType) { + this.innerModel().withNetworkType(networkType); + return this; + } + + public VirtualNetworksImpl withSubnets(List subnets) { + this.innerModel().withSubnets(subnets); + return this; + } + + public VirtualNetworksImpl withVmSwitchName(String vmSwitchName) { + this.innerModel().withVmSwitchName(vmSwitchName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsClientImpl.java similarity index 54% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsClientImpl.java index ea047f5486e1e..e91c915af6ae0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsClientImpl.java @@ -32,130 +32,139 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; -import com.azure.resourcemanager.azurestackhci.models.ExtensionList; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualNetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksUpdateRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ -public final class ExtensionsClientImpl implements ExtensionsClient { +/** An instance of this class provides access to all the operations defined in VirtualNetworksOperationsClient. */ +public final class VirtualNetworksOperationsClientImpl implements VirtualNetworksOperationsClient { /** The proxy service used to perform REST calls. */ - private final ExtensionsService service; + private final VirtualNetworksOperationsService service; /** The service client containing this operation class. */ private final AzureStackHciClientImpl client; /** - * Initializes an instance of ExtensionsClientImpl. + * Initializes an instance of VirtualNetworksOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ExtensionsClientImpl(AzureStackHciClientImpl client) { + VirtualNetworksOperationsClientImpl(AzureStackHciClientImpl client) { this.service = - RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy + .create( + VirtualNetworksOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureStackHciClientExtensions to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureStackHciClientVirtualNetworksOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureStackHciClientE") - private interface ExtensionsService { + @ServiceInterface(name = "AzureStackHciClientV") + public interface VirtualNetworksOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByArcSetting( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, + @PathParam("virtualNetworkName") String virtualNetworkName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") - @ExpectedResponses({200}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, - @PathParam("extensionName") String extensionName, + @PathParam("virtualNetworkName") String virtualNetworkName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualNetworksInner virtualNetworks, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") - @ExpectedResponses({200, 201}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, - @PathParam("extensionName") String extensionName, + @PathParam("virtualNetworkName") String virtualNetworkName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ExtensionInner extension, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, - @PathParam("extensionName") String extensionName, + @PathParam("virtualNetworkName") String virtualNetworkName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ExtensionInner extension, + @BodyParam("application/json") VirtualNetworksUpdateRequest virtualNetworks, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") - @ExpectedResponses({200, 202, 204}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @PathParam("arcSettingName") String arcSettingName, - @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listByArcSettingNext( + Mono> listAllNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -163,20 +172,19 @@ Mono> listByArcSettingNext( } /** - * List all Extensions under ArcSetting resource. + * The getByResourceGroup operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByArcSettingSinglePageAsync( - String resourceGroupName, String clusterName, String arcSettingName) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -193,54 +201,41 @@ private Mono> listByArcSettingSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByArcSetting( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + virtualNetworkName, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all Extensions under ArcSetting resource. + * The getByResourceGroup operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param virtualNetworkName Name of the virtual network. * @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 list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByArcSettingSinglePageAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -257,125 +252,87 @@ private Mono> listByArcSettingSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByArcSetting( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, + virtualNetworkName, this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * List all Extensions under ArcSetting resource. + * The getByResourceGroup operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + * @return the virtual network resource definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByArcSettingAsync( - String resourceGroupName, String clusterName, String arcSettingName) { - return new PagedFlux<>( - () -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName), - nextLink -> listByArcSettingNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all Extensions under ArcSetting resource. + * The getByResourceGroup operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param virtualNetworkName Name of the virtual network. * @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 list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + * @return the virtual network resource definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByArcSettingAsync( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return new PagedFlux<>( - () -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName, context), - nextLink -> listByArcSettingNextSinglePageAsync(nextLink, context)); - } - - /** - * List all Extensions under ArcSetting resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName) { - return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, context).block(); } /** - * List all Extensions under ArcSetting resource. + * The getByResourceGroup operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + * @return the virtual network resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworksInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE).getValue(); } /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of {@link + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -392,50 +349,50 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + if (virtualNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworks is required and cannot be null.")); + } else { + virtualNetworks.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), + virtualNetworks, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. * @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 particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of {@link + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -452,107 +409,212 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + if (virtualNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworks is required and cannot be null.")); + } else { + virtualNetworks.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), + virtualNetworks, accept, context); } /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualNetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworks); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworksInner.class, + VirtualNetworksInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualNetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualNetworksInner.class, VirtualNetworksInner.class, context); + } + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks).getSyncPoller(); + } + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster on successful completion of {@link Mono}. + * @return the virtual network resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @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 particular Arc Extension of HCI Cluster. + * @return the virtual network resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return getAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get particular Arc Extension of HCI Cluster. + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworksInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks).block(); + } + + /** + * The operation to create or update a virtual network. Please note some properties can be set only during virtual + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource definition. * @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 particular Arc Extension of HCI Cluster along with {@link Response}. + * @return the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + public VirtualNetworksInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksInner virtualNetworks, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context).block(); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String virtualNetworkName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -569,62 +631,40 @@ private Mono>> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extension == null) { - return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); - } else { - extension.validate(); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .create( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), - extension, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @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 details of a particular extension in HCI Cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String virtualNetworkName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -641,270 +681,174 @@ private Mono>> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extension == null) { - return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); - } else { - extension.validate(); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), - extension, accept, context); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExtensionInner> beginCreateAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName); return this .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExtensionInner.class, - ExtensionInner.class, - this.client.getContext()); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExtensionInner> beginCreateAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context) { + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String virtualNetworkName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), ExtensionInner.class, ExtensionInner.class, context); + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExtensionInner> beginCreate( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) - .getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName).getSyncPoller(); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExtensionInner> beginCreate( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) - .getSyncPoller(); + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, context).getSyncPoller(); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @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 details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner create( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + public void delete(String resourceGroupName, String virtualNetworkName) { + deleteAsync(resourceGroupName, virtualNetworkName).block(); } /** - * Create Extension for HCI cluster. + * The operation to delete a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. * @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 details of a particular extension in HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner create( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, - Context context) { - return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + public void delete(String resourceGroupName, String virtualNetworkName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, context).block(); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -921,19 +865,15 @@ private Mono>> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (extension == null) { - return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + if (virtualNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworks is required and cannot be null.")); } else { - extension.validate(); + virtualNetworks.validate(); } final String accept = "application/json"; return FluxUtil @@ -944,38 +884,32 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), - extension, + virtualNetworks, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @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 details of a particular extension in HCI Cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return the virtual network resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -993,19 +927,15 @@ private Mono>> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (extension == null) { - return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + if (virtualNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworks is required and cannot be null.")); } else { - extension.validate(); + virtualNetworks.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1014,243 +944,196 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, + virtualNetworkName, this.client.getApiVersion(), - extension, + virtualNetworks, accept, context); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + * @return the {@link PollerFlux} for polling of the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExtensionInner> beginUpdateAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { + private PollerFlux, VirtualNetworksInner> beginUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks) { Mono>> mono = - updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + updateWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworks); return this .client - .getLroResult( + .getLroResult( mono, this.client.getHttpPipeline(), - ExtensionInner.class, - ExtensionInner.class, + VirtualNetworksInner.class, + VirtualNetworksInner.class, this.client.getContext()); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + * @return the {@link PollerFlux} for polling of the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExtensionInner> beginUpdateAsync( + private PollerFlux, VirtualNetworksInner> beginUpdateAsync( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, Context context) { context = this.client.mergeContext(context); Mono>> mono = - updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context); + updateWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), ExtensionInner.class, ExtensionInner.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualNetworksInner.class, VirtualNetworksInner.class, context); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExtensionInner> beginUpdate( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) - .getSyncPoller(); + public SyncPoller, VirtualNetworksInner> beginUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks) { + return this.beginUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks).getSyncPoller(); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + * @return the {@link SyncPoller} for polling of the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExtensionInner> beginUpdate( + public SyncPoller, VirtualNetworksInner> beginUpdate( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) - .getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context).getSyncPoller(); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + * @return the virtual network resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + private Mono updateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks) { + return beginUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @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 details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + * @return the virtual network resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( + private Mono updateAsync( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + return beginUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a particular extension in HCI Cluster. + * @return the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner update( - String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + public VirtualNetworksInner update( + String resourceGroupName, String virtualNetworkName, VirtualNetworksUpdateRequest virtualNetworks) { + return updateAsync(resourceGroupName, virtualNetworkName, virtualNetworks).block(); } /** - * Update Extension for HCI cluster. + * The operation to update a virtual network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @param extension Details of the Machine Extension to be created. + * @param virtualNetworkName Name of the virtual network. + * @param virtualNetworks The virtual network resource patch definition. * @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 details of a particular extension in HCI Cluster. + * @return the virtual network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner update( + public VirtualNetworksInner update( String resourceGroupName, - String clusterName, - String arcSettingName, - String extensionName, - ExtensionInner extension, + String virtualNetworkName, + VirtualNetworksUpdateRequest virtualNetworks, Context context) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + return updateAsync(resourceGroupName, virtualNetworkName, virtualNetworks, context).block(); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1267,49 +1150,44 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, this.client.getApiVersion(), 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())); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @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}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1326,201 +1204,323 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (arcSettingName == null) { - return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, - arcSettingName, - extensionName, this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + 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.getSubscriptionId(), + this.client.getApiVersion(), + 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())); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + private Mono> listNextSinglePageAsync(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.listNext(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())); } /** - * Delete particular Arc Extension of HCI Cluster. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @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 body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + private Mono> listNextSinglePageAsync(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 + .listNext(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 nextLink parameter. + * @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 list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByArcSettingNextSinglePageAsync(String nextLink) { + private Mono> listAllNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1532,8 +1532,8 @@ private Mono> listByArcSettingNextSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByArcSettingNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1548,16 +1548,16 @@ private Mono> listByArcSettingNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByArcSettingNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1570,7 +1570,7 @@ private Mono> listByArcSettingNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByArcSettingNext(nextLink, this.client.getEndpoint(), accept, context) + .listAllNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsImpl.java new file mode 100644 index 0000000000000..744c5aab851a4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualNetworksOperationsImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualNetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworksOperations; + +public final class VirtualNetworksOperationsImpl implements VirtualNetworksOperations { + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworksOperationsImpl.class); + + private final VirtualNetworksOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualNetworksOperationsImpl( + VirtualNetworksOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworksImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualNetworks getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + VirtualNetworksInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); + if (inner != null) { + return new VirtualNetworksImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualNetworksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworksImpl(inner1, this.manager())); + } + + public VirtualNetworks 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, Context.NONE); + } + + public void 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, context); + } + + private VirtualNetworksOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public VirtualNetworksImpl define(String name) { + return new VirtualNetworksImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java deleted file mode 100644 index 2b1410993e7d7..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java +++ /dev/null @@ -1,35 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ActionType. */ -public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - @JsonCreator - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java deleted file mode 100644 index 970adcaa4bf88..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java +++ /dev/null @@ -1,45 +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.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; - -/** An immutable client-side representation of ArcIdentityResponse. */ -public interface ArcIdentityResponse { - /** - * Gets the arcApplicationClientId property: The arcApplicationClientId property. - * - * @return the arcApplicationClientId value. - */ - String arcApplicationClientId(); - - /** - * Gets the arcApplicationTenantId property: The arcApplicationTenantId property. - * - * @return the arcApplicationTenantId value. - */ - String arcApplicationTenantId(); - - /** - * Gets the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. - * - * @return the arcServicePrincipalObjectId value. - */ - String arcServicePrincipalObjectId(); - - /** - * Gets the arcApplicationObjectId property: The arcApplicationObjectId property. - * - * @return the arcApplicationObjectId value. - */ - String arcApplicationObjectId(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner object. - * - * @return the inner object. - */ - ArcIdentityResponseInner innerModel(); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java deleted file mode 100644 index db757dbf992a7..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java +++ /dev/null @@ -1,334 +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.azurestackhci.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of ArcSetting. */ -public interface ArcSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: System data of ArcSetting resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Provisioning state of the ArcSetting proxy resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute - * Machine resources. - * - * @return the arcInstanceResourceGroup value. - */ - String arcInstanceResourceGroup(); - - /** - * Gets the arcApplicationClientId property: App id of arc AAD identity. - * - * @return the arcApplicationClientId value. - */ - String arcApplicationClientId(); - - /** - * Gets the arcApplicationTenantId property: Tenant id of arc AAD identity. - * - * @return the arcApplicationTenantId value. - */ - String arcApplicationTenantId(); - - /** - * Gets the arcServicePrincipalObjectId property: Object id of arc AAD service principal. - * - * @return the arcServicePrincipalObjectId value. - */ - String arcServicePrincipalObjectId(); - - /** - * Gets the arcApplicationObjectId property: Object id of arc AAD identity. - * - * @return the arcApplicationObjectId value. - */ - String arcApplicationObjectId(); - - /** - * Gets the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - ArcSettingAggregateState aggregateState(); - - /** - * Gets the perNodeDetails property: State of Arc agent in each of the nodes. - * - * @return the perNodeDetails value. - */ - List perNodeDetails(); - - /** - * Gets the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @return the connectivityProperties value. - */ - Object connectivityProperties(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner object. - * - * @return the inner object. - */ - ArcSettingInner innerModel(); - - /** The entirety of the ArcSetting definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The ArcSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the ArcSetting definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the ArcSetting definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, clusterName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @return the next definition stage. - */ - WithCreate withExistingCluster(String resourceGroupName, String clusterName); - } - /** - * The stage of the ArcSetting 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.WithArcInstanceResourceGroup, - DefinitionStages.WithArcApplicationClientId, - DefinitionStages.WithArcApplicationTenantId, - DefinitionStages.WithArcServicePrincipalObjectId, - DefinitionStages.WithArcApplicationObjectId, - DefinitionStages.WithConnectivityProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - ArcSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ArcSetting create(Context context); - } - /** The stage of the ArcSetting definition allowing to specify arcInstanceResourceGroup. */ - interface WithArcInstanceResourceGroup { - /** - * Specifies the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid - * Compute Machine resources.. - * - * @param arcInstanceResourceGroup The resource group that hosts the Arc agents, ie. Hybrid Compute Machine - * resources. - * @return the next definition stage. - */ - WithCreate withArcInstanceResourceGroup(String arcInstanceResourceGroup); - } - /** The stage of the ArcSetting definition allowing to specify arcApplicationClientId. */ - interface WithArcApplicationClientId { - /** - * Specifies the arcApplicationClientId property: App id of arc AAD identity.. - * - * @param arcApplicationClientId App id of arc AAD identity. - * @return the next definition stage. - */ - WithCreate withArcApplicationClientId(String arcApplicationClientId); - } - /** The stage of the ArcSetting definition allowing to specify arcApplicationTenantId. */ - interface WithArcApplicationTenantId { - /** - * Specifies the arcApplicationTenantId property: Tenant id of arc AAD identity.. - * - * @param arcApplicationTenantId Tenant id of arc AAD identity. - * @return the next definition stage. - */ - WithCreate withArcApplicationTenantId(String arcApplicationTenantId); - } - /** The stage of the ArcSetting definition allowing to specify arcServicePrincipalObjectId. */ - interface WithArcServicePrincipalObjectId { - /** - * Specifies the arcServicePrincipalObjectId property: Object id of arc AAD service principal.. - * - * @param arcServicePrincipalObjectId Object id of arc AAD service principal. - * @return the next definition stage. - */ - WithCreate withArcServicePrincipalObjectId(String arcServicePrincipalObjectId); - } - /** The stage of the ArcSetting definition allowing to specify arcApplicationObjectId. */ - interface WithArcApplicationObjectId { - /** - * Specifies the arcApplicationObjectId property: Object id of arc AAD identity.. - * - * @param arcApplicationObjectId Object id of arc AAD identity. - * @return the next definition stage. - */ - WithCreate withArcApplicationObjectId(String arcApplicationObjectId); - } - /** The stage of the ArcSetting definition allowing to specify connectivityProperties. */ - interface WithConnectivityProperties { - /** - * Specifies the connectivityProperties property: contains connectivity related configuration for ARC - * resources. - * - * @param connectivityProperties contains connectivity related configuration for ARC resources. - * @return the next definition stage. - */ - WithCreate withConnectivityProperties(Object connectivityProperties); - } - } - /** - * Begins update for the ArcSetting resource. - * - * @return the stage of resource update. - */ - ArcSetting.Update update(); - - /** The template for ArcSetting update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithConnectivityProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ArcSetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ArcSetting apply(Context context); - } - /** The ArcSetting update stages. */ - interface UpdateStages { - /** The stage of the ArcSetting update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the ArcSetting update allowing to specify connectivityProperties. */ - interface WithConnectivityProperties { - /** - * Specifies the connectivityProperties property: contains connectivity related configuration for ARC - * resources. - * - * @param connectivityProperties contains connectivity related configuration for ARC resources. - * @return the next definition stage. - */ - Update withConnectivityProperties(Object connectivityProperties); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ArcSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ArcSetting refresh(Context context); - - /** - * Generate password for arc settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - PasswordCredential generatePassword(); - - /** - * Generate password for arc settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response generatePasswordWithResponse(Context context); - - /** - * Create Aad identity for arc settings. - * - * @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 arcIdentity details. - */ - ArcIdentityResponse createIdentity(); - - /** - * Create Aad identity for arc settings. - * - * @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 arcIdentity details. - */ - ArcIdentityResponse createIdentity(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java deleted file mode 100644 index b784d7a58be9e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ArcSettingAggregateState. */ -public final class ArcSettingAggregateState extends ExpandableStringEnum { - /** Static value NotSpecified for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value Error for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState ERROR = fromString("Error"); - - /** Static value Succeeded for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState SUCCEEDED = fromString("Succeeded"); - - /** Static value Canceled for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState CANCELED = fromString("Canceled"); - - /** Static value Failed for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState FAILED = fromString("Failed"); - - /** Static value Connected for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState CONNECTED = fromString("Connected"); - - /** Static value Disconnected for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState DISCONNECTED = fromString("Disconnected"); - - /** Static value Deleted for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState DELETED = fromString("Deleted"); - - /** Static value Creating for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState CREATING = fromString("Creating"); - - /** Static value Updating for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState UPDATING = fromString("Updating"); - - /** Static value Deleting for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState DELETING = fromString("Deleting"); - - /** Static value Moving for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState MOVING = fromString("Moving"); - - /** Static value PartiallySucceeded for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); - - /** Static value PartiallyConnected for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); - - /** Static value InProgress for ArcSettingAggregateState. */ - public static final ArcSettingAggregateState IN_PROGRESS = fromString("InProgress"); - - /** - * Creates or finds a ArcSettingAggregateState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ArcSettingAggregateState. - */ - @JsonCreator - public static ArcSettingAggregateState fromString(String name) { - return fromString(name, ArcSettingAggregateState.class); - } - - /** - * Gets known ArcSettingAggregateState values. - * - * @return known ArcSettingAggregateState values. - */ - public static Collection values() { - return values(ArcSettingAggregateState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java deleted file mode 100644 index 877c5efa98071..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of ArcSetting proxy resources for the HCI cluster. */ -@Immutable -public final class ArcSettingList { - /* - * List of ArcSetting proxy resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of ArcSetting proxy resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java deleted file mode 100644 index d58145da942f6..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java +++ /dev/null @@ -1,198 +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.azurestackhci.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 ArcSettings. */ -public interface ArcSettings { - /** - * Get ArcSetting resources of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. - */ - PagedIterable listByCluster(String resourceGroupName, String clusterName); - - /** - * Get ArcSetting resources of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. - */ - PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); - - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 arcSetting resource details of HCI Cluster. - */ - ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); - - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 arcSetting resource details of HCI Cluster along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); - - /** - * Delete ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String clusterName, String arcSettingName); - - /** - * Delete ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); - - /** - * Generate password for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); - - /** - * Generate password for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); - - /** - * Create Aad identity for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 arcIdentity details. - */ - ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName); - - /** - * Create Aad identity for arc settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @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 arcIdentity details. - */ - ArcIdentityResponse createIdentity( - String resourceGroupName, String clusterName, String arcSettingName, Context context); - - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @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 arcSetting resource details of HCI Cluster along with {@link Response}. - */ - ArcSetting getById(String id); - - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @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 arcSetting resource details of HCI Cluster along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete ArcSetting resource details of HCI Cluster. - * - * @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 ArcSetting resource details of HCI Cluster. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ArcSetting resource. - * - * @param name resource name. - * @return the first stage of the new ArcSetting definition. - */ - ArcSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java deleted file mode 100644 index b9187894e0c5e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java +++ /dev/null @@ -1,91 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingsPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** ArcSetting details to update. */ -@Fluent -public final class ArcSettingsPatch { - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * ArcSettings properties. - */ - @JsonProperty(value = "properties") - private ArcSettingsPatchProperties innerProperties; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ArcSettingsPatch object itself. - */ - public ArcSettingsPatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: ArcSettings properties. - * - * @return the innerProperties value. - */ - private ArcSettingsPatchProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @return the connectivityProperties value. - */ - public Object connectivityProperties() { - return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); - } - - /** - * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. - * - * @param connectivityProperties the connectivityProperties value to set. - * @return the ArcSettingsPatch object itself. - */ - public ArcSettingsPatch withConnectivityProperties(Object connectivityProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ArcSettingsPatchProperties(); - } - this.innerProperties().withConnectivityProperties(connectivityProperties); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CloudInitDataSource.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CloudInitDataSource.java new file mode 100644 index 0000000000000..501aace99479f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CloudInitDataSource.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]. */ +public final class CloudInitDataSource extends ExpandableStringEnum { + /** Static value NoCloud for CloudInitDataSource. */ + public static final CloudInitDataSource NO_CLOUD = fromString("NoCloud"); + + /** Static value Azure for CloudInitDataSource. */ + public static final CloudInitDataSource AZURE = fromString("Azure"); + + /** + * Creates a new instance of CloudInitDataSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudInitDataSource() { + } + + /** + * Creates or finds a CloudInitDataSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudInitDataSource. + */ + @JsonCreator + public static CloudInitDataSource fromString(String name) { + return fromString(name, CloudInitDataSource.class); + } + + /** + * Gets known CloudInitDataSource values. + * + * @return known CloudInitDataSource values. + */ + public static Collection values() { + return values(CloudInitDataSource.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java deleted file mode 100644 index 1bc5810040be0..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ /dev/null @@ -1,474 +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.azurestackhci.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of Cluster. */ -public interface Cluster { - /** - * 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: System data of Cluster resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the status property: Status of the cluster agent. - * - * @return the status value. - */ - Status status(); - - /** - * Gets the cloudId property: Unique, immutable resource id. - * - * @return the cloudId value. - */ - String cloudId(); - - /** - * Gets the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @return the cloudManagementEndpoint value. - */ - String cloudManagementEndpoint(); - - /** - * Gets the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - String aadClientId(); - - /** - * Gets the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - String aadTenantId(); - - /** - * Gets the aadApplicationObjectId property: Object id of cluster AAD identity. - * - * @return the aadApplicationObjectId value. - */ - String aadApplicationObjectId(); - - /** - * Gets the aadServicePrincipalObjectId property: Id of cluster identity service principal. - * - * @return the aadServicePrincipalObjectId value. - */ - String aadServicePrincipalObjectId(); - - /** - * Gets the desiredProperties property: Desired properties of the cluster. - * - * @return the desiredProperties value. - */ - ClusterDesiredProperties desiredProperties(); - - /** - * Gets the reportedProperties property: Properties reported by cluster agent. - * - * @return the reportedProperties value. - */ - ClusterReportedProperties reportedProperties(); - - /** - * Gets the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - Float trialDaysRemaining(); - - /** - * Gets the billingModel property: Type of billing applied to the resource. - * - * @return the billingModel value. - */ - String billingModel(); - - /** - * Gets the registrationTimestamp property: First cluster sync timestamp. - * - * @return the registrationTimestamp value. - */ - OffsetDateTime registrationTimestamp(); - - /** - * Gets the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - OffsetDateTime lastSyncTimestamp(); - - /** - * Gets the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - OffsetDateTime lastBillingTimestamp(); - - /** - * Gets the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. - * - * @return the serviceEndpoint value. - */ - String serviceEndpoint(); - - /** - * 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.azurestackhci.fluent.models.ClusterInner object. - * - * @return the inner object. - */ - ClusterInner innerModel(); - - /** The entirety of the Cluster definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The Cluster definition stages. */ - interface DefinitionStages { - /** The first stage of the Cluster definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Cluster 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 Cluster 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 Cluster 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.WithCloudManagementEndpoint, - DefinitionStages.WithAadClientId, - DefinitionStages.WithAadTenantId, - DefinitionStages.WithAadApplicationObjectId, - DefinitionStages.WithAadServicePrincipalObjectId, - DefinitionStages.WithDesiredProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - Cluster create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Cluster create(Context context); - } - /** The stage of the Cluster 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 Cluster definition allowing to specify cloudManagementEndpoint. */ - interface WithCloudManagementEndpoint { - /** - * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure - * portal.. - * - * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. - * @return the next definition stage. - */ - WithCreate withCloudManagementEndpoint(String cloudManagementEndpoint); - } - /** The stage of the Cluster definition allowing to specify aadClientId. */ - interface WithAadClientId { - /** - * Specifies the aadClientId property: App id of cluster AAD identity.. - * - * @param aadClientId App id of cluster AAD identity. - * @return the next definition stage. - */ - WithCreate withAadClientId(String aadClientId); - } - /** The stage of the Cluster definition allowing to specify aadTenantId. */ - interface WithAadTenantId { - /** - * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. - * - * @param aadTenantId Tenant id of cluster AAD identity. - * @return the next definition stage. - */ - WithCreate withAadTenantId(String aadTenantId); - } - /** The stage of the Cluster definition allowing to specify aadApplicationObjectId. */ - interface WithAadApplicationObjectId { - /** - * Specifies the aadApplicationObjectId property: Object id of cluster AAD identity.. - * - * @param aadApplicationObjectId Object id of cluster AAD identity. - * @return the next definition stage. - */ - WithCreate withAadApplicationObjectId(String aadApplicationObjectId); - } - /** The stage of the Cluster definition allowing to specify aadServicePrincipalObjectId. */ - interface WithAadServicePrincipalObjectId { - /** - * Specifies the aadServicePrincipalObjectId property: Id of cluster identity service principal.. - * - * @param aadServicePrincipalObjectId Id of cluster identity service principal. - * @return the next definition stage. - */ - WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); - } - /** The stage of the Cluster definition allowing to specify desiredProperties. */ - interface WithDesiredProperties { - /** - * Specifies the desiredProperties property: Desired properties of the cluster.. - * - * @param desiredProperties Desired properties of the cluster. - * @return the next definition stage. - */ - WithCreate withDesiredProperties(ClusterDesiredProperties desiredProperties); - } - } - /** - * Begins update for the Cluster resource. - * - * @return the stage of resource update. - */ - Cluster.Update update(); - - /** The template for Cluster update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithCloudManagementEndpoint, - UpdateStages.WithAadClientId, - UpdateStages.WithAadTenantId, - UpdateStages.WithDesiredProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Cluster apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Cluster apply(Context context); - } - /** The Cluster update stages. */ - interface UpdateStages { - /** The stage of the Cluster update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the Cluster update allowing to specify cloudManagementEndpoint. */ - interface WithCloudManagementEndpoint { - /** - * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. - * @return the next definition stage. - */ - Update withCloudManagementEndpoint(String cloudManagementEndpoint); - } - /** The stage of the Cluster update allowing to specify aadClientId. */ - interface WithAadClientId { - /** - * Specifies the aadClientId property: App id of cluster AAD identity.. - * - * @param aadClientId App id of cluster AAD identity. - * @return the next definition stage. - */ - Update withAadClientId(String aadClientId); - } - /** The stage of the Cluster update allowing to specify aadTenantId. */ - interface WithAadTenantId { - /** - * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. - * - * @param aadTenantId Tenant id of cluster AAD identity. - * @return the next definition stage. - */ - Update withAadTenantId(String aadTenantId); - } - /** The stage of the Cluster update allowing to specify desiredProperties. */ - interface WithDesiredProperties { - /** - * Specifies the desiredProperties property: Desired properties of the cluster.. - * - * @param desiredProperties Desired properties of the cluster. - * @return the next definition stage. - */ - Update withDesiredProperties(ClusterDesiredProperties desiredProperties); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Cluster refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Cluster refresh(Context context); - - /** - * Upload certificate. - * - * @param uploadCertificateRequest Upload certificate request. - * @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 uploadCertificate(UploadCertificateRequest uploadCertificateRequest); - - /** - * Upload certificate. - * - * @param uploadCertificateRequest Upload certificate request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context); - - /** - * Create cluster identity. - * - * @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 cluster Identity details. - */ - ClusterIdentityResponse createIdentity(); - - /** - * Create cluster identity. - * - * @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 cluster Identity details. - */ - ClusterIdentityResponse createIdentity(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java deleted file mode 100644 index 6047cd6aac00a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java +++ /dev/null @@ -1,72 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Desired properties of the cluster. */ -@Fluent -public final class ClusterDesiredProperties { - /* - * Desired state of Windows Server Subscription. - */ - @JsonProperty(value = "windowsServerSubscription") - private WindowsServerSubscription windowsServerSubscription; - - /* - * Desired level of diagnostic data emitted by the cluster. - */ - @JsonProperty(value = "diagnosticLevel") - private DiagnosticLevel diagnosticLevel; - - /** - * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. - * - * @return the windowsServerSubscription value. - */ - public WindowsServerSubscription windowsServerSubscription() { - return this.windowsServerSubscription; - } - - /** - * Set the windowsServerSubscription property: Desired state of Windows Server Subscription. - * - * @param windowsServerSubscription the windowsServerSubscription value to set. - * @return the ClusterDesiredProperties object itself. - */ - public ClusterDesiredProperties withWindowsServerSubscription(WindowsServerSubscription windowsServerSubscription) { - this.windowsServerSubscription = windowsServerSubscription; - return this; - } - - /** - * Get the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. - * - * @return the diagnosticLevel value. - */ - public DiagnosticLevel diagnosticLevel() { - return this.diagnosticLevel; - } - - /** - * Set the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. - * - * @param diagnosticLevel the diagnosticLevel value to set. - * @return the ClusterDesiredProperties object itself. - */ - public ClusterDesiredProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { - this.diagnosticLevel = diagnosticLevel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java deleted file mode 100644 index 296b523f8462d..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java +++ /dev/null @@ -1,45 +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.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; - -/** An immutable client-side representation of ClusterIdentityResponse. */ -public interface ClusterIdentityResponse { - /** - * Gets the aadClientId property: The aadClientId property. - * - * @return the aadClientId value. - */ - String aadClientId(); - - /** - * Gets the aadTenantId property: The aadTenantId property. - * - * @return the aadTenantId value. - */ - String aadTenantId(); - - /** - * Gets the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. - * - * @return the aadServicePrincipalObjectId value. - */ - String aadServicePrincipalObjectId(); - - /** - * Gets the aadApplicationObjectId property: The aadApplicationObjectId property. - * - * @return the aadApplicationObjectId value. - */ - String aadApplicationObjectId(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner object. - * - * @return the inner object. - */ - ClusterIdentityResponseInner innerModel(); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java deleted file mode 100644 index 1d7a5a571ed42..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java +++ /dev/null @@ -1,170 +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.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Cluster node details. */ -@Immutable -public final class ClusterNode { - /* - * Name of the cluster node. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Id of the node in the cluster. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private Float id; - - /* - * State of Windows Server Subscription. - */ - @JsonProperty(value = "windowsServerSubscription", access = JsonProperty.Access.WRITE_ONLY) - private WindowsServerSubscription windowsServerSubscription; - - /* - * Manufacturer of the cluster node hardware. - */ - @JsonProperty(value = "manufacturer", access = JsonProperty.Access.WRITE_ONLY) - private String manufacturer; - - /* - * Model name of the cluster node hardware. - */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) - private String model; - - /* - * Operating system running on the cluster node. - */ - @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) - private String osName; - - /* - * Version of the operating system running on the cluster node. - */ - @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) - private String osVersion; - - /* - * Immutable id of the cluster node. - */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) - private String serialNumber; - - /* - * Number of physical cores on the cluster node. - */ - @JsonProperty(value = "coreCount", access = JsonProperty.Access.WRITE_ONLY) - private Float coreCount; - - /* - * Total available memory on the cluster node (in GiB). - */ - @JsonProperty(value = "memoryInGiB", access = JsonProperty.Access.WRITE_ONLY) - private Float memoryInGiB; - - /** - * Get the name property: Name of the cluster node. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the id property: Id of the node in the cluster. - * - * @return the id value. - */ - public Float id() { - return this.id; - } - - /** - * Get the windowsServerSubscription property: State of Windows Server Subscription. - * - * @return the windowsServerSubscription value. - */ - public WindowsServerSubscription windowsServerSubscription() { - return this.windowsServerSubscription; - } - - /** - * Get the manufacturer property: Manufacturer of the cluster node hardware. - * - * @return the manufacturer value. - */ - public String manufacturer() { - return this.manufacturer; - } - - /** - * Get the model property: Model name of the cluster node hardware. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Get the osName property: Operating system running on the cluster node. - * - * @return the osName value. - */ - public String osName() { - return this.osName; - } - - /** - * Get the osVersion property: Version of the operating system running on the cluster node. - * - * @return the osVersion value. - */ - public String osVersion() { - return this.osVersion; - } - - /** - * Get the serialNumber property: Immutable id of the cluster node. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Get the coreCount property: Number of physical cores on the cluster node. - * - * @return the coreCount value. - */ - public Float coreCount() { - return this.coreCount; - } - - /** - * Get the memoryInGiB property: Total available memory on the cluster node (in GiB). - * - * @return the memoryInGiB value. - */ - public Float memoryInGiB() { - return this.memoryInGiB; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java deleted file mode 100644 index 2004f6129e9fe..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java +++ /dev/null @@ -1,160 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Cluster details to update. */ -@Fluent -public final class ClusterPatch { - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * Cluster properties. - */ - @JsonProperty(value = "properties") - private ClusterPatchProperties innerProperties; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ClusterPatch object itself. - */ - public ClusterPatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: Cluster properties. - * - * @return the innerProperties value. - */ - private ClusterPatchProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @return the cloudManagementEndpoint value. - */ - public String cloudManagementEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); - } - - /** - * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. - * - * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. - * @return the ClusterPatch object itself. - */ - public ClusterPatch withCloudManagementEndpoint(String cloudManagementEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterPatchProperties(); - } - this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); - return this; - } - - /** - * Get the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); - } - - /** - * Set the aadClientId property: App id of cluster AAD identity. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterPatch object itself. - */ - public ClusterPatch withAadClientId(String aadClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterPatchProperties(); - } - this.innerProperties().withAadClientId(aadClientId); - return this; - } - - /** - * Get the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); - } - - /** - * Set the aadTenantId property: Tenant id of cluster AAD identity. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterPatch object itself. - */ - public ClusterPatch withAadTenantId(String aadTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterPatchProperties(); - } - this.innerProperties().withAadTenantId(aadTenantId); - return this; - } - - /** - * Get the desiredProperties property: Desired properties of the cluster. - * - * @return the desiredProperties value. - */ - public ClusterDesiredProperties desiredProperties() { - return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); - } - - /** - * Set the desiredProperties property: Desired properties of the cluster. - * - * @param desiredProperties the desiredProperties value to set. - * @return the ClusterPatch object itself. - */ - public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterPatchProperties(); - } - this.innerProperties().withDesiredProperties(desiredProperties); - 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java deleted file mode 100644 index 4a2d2b7c7895d..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java +++ /dev/null @@ -1,141 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Properties reported by cluster agent. */ -@Fluent -public final class ClusterReportedProperties { - /* - * Name of the on-prem cluster connected to this resource. - */ - @JsonProperty(value = "clusterName", access = JsonProperty.Access.WRITE_ONLY) - private String clusterName; - - /* - * Unique id generated by the on-prem cluster. - */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) - private String clusterId; - - /* - * Version of the cluster software. - */ - @JsonProperty(value = "clusterVersion", access = JsonProperty.Access.WRITE_ONLY) - private String clusterVersion; - - /* - * List of nodes reported by the cluster. - */ - @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) - private List nodes; - - /* - * Last time the cluster reported the data. - */ - @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdated; - - /* - * IMDS attestation status of the cluster. - */ - @JsonProperty(value = "imdsAttestation", access = JsonProperty.Access.WRITE_ONLY) - private ImdsAttestation imdsAttestation; - - /* - * Level of diagnostic data emitted by the cluster. - */ - @JsonProperty(value = "diagnosticLevel") - private DiagnosticLevel diagnosticLevel; - - /** - * Get the clusterName property: Name of the on-prem cluster connected to this resource. - * - * @return the clusterName value. - */ - public String clusterName() { - return this.clusterName; - } - - /** - * Get the clusterId property: Unique id generated by the on-prem cluster. - * - * @return the clusterId value. - */ - public String clusterId() { - return this.clusterId; - } - - /** - * Get the clusterVersion property: Version of the cluster software. - * - * @return the clusterVersion value. - */ - public String clusterVersion() { - return this.clusterVersion; - } - - /** - * Get the nodes property: List of nodes reported by the cluster. - * - * @return the nodes value. - */ - public List nodes() { - return this.nodes; - } - - /** - * Get the lastUpdated property: Last time the cluster reported the data. - * - * @return the lastUpdated value. - */ - public OffsetDateTime lastUpdated() { - return this.lastUpdated; - } - - /** - * Get the imdsAttestation property: IMDS attestation status of the cluster. - * - * @return the imdsAttestation value. - */ - public ImdsAttestation imdsAttestation() { - return this.imdsAttestation; - } - - /** - * Get the diagnosticLevel property: Level of diagnostic data emitted by the cluster. - * - * @return the diagnosticLevel value. - */ - public DiagnosticLevel diagnosticLevel() { - return this.diagnosticLevel; - } - - /** - * Set the diagnosticLevel property: Level of diagnostic data emitted by the cluster. - * - * @param diagnosticLevel the diagnosticLevel value to set. - * @return the ClusterReportedProperties object itself. - */ - public ClusterReportedProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { - this.diagnosticLevel = diagnosticLevel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (nodes() != null) { - nodes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable.java new file mode 100644 index 0000000000000..32f5a8e3bf79f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable for the subnet. */ +@Fluent +public final class ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable { + /* + * Etag - Gets a unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name - READ-ONLY; Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * RouteTablePropertiesFormat route Table resource. + */ + @JsonProperty(value = "properties") + private Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + innerProperties; + + /* + * Type - READ-ONLY; Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Creates an instance of ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable + * class. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable() { + } + + /** + * Get the id property: Etag - Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Etag - Gets a unique read-only string that changes whenever the resource is updated. + * + * @param id the id value to set. + * @return the ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name - READ-ONLY; Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - READ-ONLY; Resource name. + * + * @param name the name value to set. + * @return the ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable withName( + String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: RouteTablePropertiesFormat route Table resource. + * + * @return the innerProperties value. + */ + private Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: Type - READ-ONLY; Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type - READ-ONLY; Resource type. + * + * @param type the type value to set. + * @return the ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable withType( + String type) { + this.type = type; + return this; + } + + /** + * Get the routes property: Routes - Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.innerProperties() == null ? null : this.innerProperties().routes(); + } + + /** + * Set the routes property: Routes - Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable withRoutes( + List routes) { + if (this.innerProperties() == null) { + this.innerProperties = + new Components3Iu67JSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties(); + } + this.innerProperties().withRoutes(routes); + 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java deleted file mode 100644 index 055016a21b28a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java +++ /dev/null @@ -1,41 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiagnosticLevel. */ -public final class DiagnosticLevel extends ExpandableStringEnum { - /** Static value Off for DiagnosticLevel. */ - public static final DiagnosticLevel OFF = fromString("Off"); - - /** Static value Basic for DiagnosticLevel. */ - public static final DiagnosticLevel BASIC = fromString("Basic"); - - /** Static value Enhanced for DiagnosticLevel. */ - public static final DiagnosticLevel ENHANCED = fromString("Enhanced"); - - /** - * Creates or finds a DiagnosticLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiagnosticLevel. - */ - @JsonCreator - public static DiagnosticLevel fromString(String name) { - return fromString(name, DiagnosticLevel.class); - } - - /** - * Gets known DiagnosticLevel values. - * - * @return known DiagnosticLevel values. - */ - public static Collection values() { - return values(DiagnosticLevel.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.java new file mode 100644 index 0000000000000..a364631c4eddd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The format of the actual VHD file [vhd, vhdx]. */ +public final class DiskFileFormat extends ExpandableStringEnum { + /** Static value vhdx for DiskFileFormat. */ + public static final DiskFileFormat VHDX = fromString("vhdx"); + + /** Static value vhd for DiskFileFormat. */ + public static final DiskFileFormat VHD = fromString("vhd"); + + /** + * Creates a new instance of DiskFileFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskFileFormat() { + } + + /** + * Creates or finds a DiskFileFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskFileFormat. + */ + @JsonCreator + public static DiskFileFormat fromString(String name) { + return fromString(name, DiskFileFormat.class); + } + + /** + * Gets known DiskFileFormat values. + * + * @return known DiskFileFormat values. + */ + public static Collection values() { + return values(DiskFileFormat.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java new file mode 100644 index 0000000000000..89b453378f134 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocationTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..acbaaa66f71a9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocationTypes.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of extendedLocation. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value CustomLocation for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes CUSTOM_LOCATION = fromString("CustomLocation"); + + /** + * Creates a new instance of ExtendedLocationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationTypes() { + } + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java deleted file mode 100644 index 6ca8c95e770fe..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java +++ /dev/null @@ -1,380 +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.azurestackhci.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; -import java.util.List; - -/** An immutable client-side representation of Extension. */ -public interface Extension { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: System data of Extension resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Provisioning state of the Extension proxy resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. - * - * @return the aggregateState value. - */ - ExtensionAggregateState aggregateState(); - - /** - * Gets the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. - * - * @return the perNodeExtensionDetails value. - */ - List perNodeExtensionDetails(); - - /** - * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - String forceUpdateTag(); - - /** - * Gets the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the typePropertiesType value. - */ - String typePropertiesType(); - - /** - * Gets the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - String typeHandlerVersion(); - - /** - * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if - * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - Boolean autoUpgradeMinorVersion(); - - /** - * Gets the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - Object settings(); - - /** - * Gets the protectedSettings property: Protected settings (may contain secrets). - * - * @return the protectedSettings value. - */ - Object protectedSettings(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner object. - * - * @return the inner object. - */ - ExtensionInner innerModel(); - - /** The entirety of the Extension definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The Extension definition stages. */ - interface DefinitionStages { - /** The first stage of the Extension definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the Extension definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, clusterName, arcSettingName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @return the next definition stage. - */ - WithCreate withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName); - } - /** - * The stage of the Extension 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.WithForceUpdateTag, - DefinitionStages.WithPublisher, - DefinitionStages.WithTypePropertiesType, - DefinitionStages.WithTypeHandlerVersion, - DefinitionStages.WithAutoUpgradeMinorVersion, - DefinitionStages.WithSettings, - DefinitionStages.WithProtectedSettings { - /** - * Executes the create request. - * - * @return the created resource. - */ - Extension create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Extension create(Context context); - } - /** The stage of the Extension definition allowing to specify forceUpdateTag. */ - interface WithForceUpdateTag { - /** - * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the - * extension configuration has not changed.. - * - * @param forceUpdateTag How the extension handler should be forced to update even if the extension - * configuration has not changed. - * @return the next definition stage. - */ - WithCreate withForceUpdateTag(String forceUpdateTag); - } - /** The stage of the Extension definition allowing to specify publisher. */ - interface WithPublisher { - /** - * Specifies the publisher property: The name of the extension handler publisher.. - * - * @param publisher The name of the extension handler publisher. - * @return the next definition stage. - */ - WithCreate withPublisher(String publisher); - } - /** The stage of the Extension definition allowing to specify typePropertiesType. */ - interface WithTypePropertiesType { - /** - * Specifies the typePropertiesType property: Specifies the type of the extension; an example is - * "CustomScriptExtension".. - * - * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". - * @return the next definition stage. - */ - WithCreate withTypePropertiesType(String typePropertiesType); - } - /** The stage of the Extension definition allowing to specify typeHandlerVersion. */ - interface WithTypeHandlerVersion { - /** - * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. - * - * @param typeHandlerVersion Specifies the version of the script handler. - * @return the next definition stage. - */ - WithCreate withTypeHandlerVersion(String typeHandlerVersion); - } - /** The stage of the Extension definition allowing to specify autoUpgradeMinorVersion. */ - interface WithAutoUpgradeMinorVersion { - /** - * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor - * version if one is available at deployment time. Once deployed, however, the extension will not upgrade - * minor versions unless redeployed, even with this property set to true.. - * - * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is - * available at deployment time. Once deployed, however, the extension will not upgrade minor versions - * unless redeployed, even with this property set to true. - * @return the next definition stage. - */ - WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); - } - /** The stage of the Extension definition allowing to specify settings. */ - interface WithSettings { - /** - * Specifies the settings property: Json formatted public settings for the extension.. - * - * @param settings Json formatted public settings for the extension. - * @return the next definition stage. - */ - WithCreate withSettings(Object settings); - } - /** The stage of the Extension definition allowing to specify protectedSettings. */ - interface WithProtectedSettings { - /** - * Specifies the protectedSettings property: Protected settings (may contain secrets).. - * - * @param protectedSettings Protected settings (may contain secrets). - * @return the next definition stage. - */ - WithCreate withProtectedSettings(Object protectedSettings); - } - } - /** - * Begins update for the Extension resource. - * - * @return the stage of resource update. - */ - Extension.Update update(); - - /** The template for Extension update. */ - interface Update - extends UpdateStages.WithForceUpdateTag, - UpdateStages.WithPublisher, - UpdateStages.WithTypePropertiesType, - UpdateStages.WithTypeHandlerVersion, - UpdateStages.WithAutoUpgradeMinorVersion, - UpdateStages.WithSettings, - UpdateStages.WithProtectedSettings { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Extension apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Extension apply(Context context); - } - /** The Extension update stages. */ - interface UpdateStages { - /** The stage of the Extension update allowing to specify forceUpdateTag. */ - interface WithForceUpdateTag { - /** - * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the - * extension configuration has not changed.. - * - * @param forceUpdateTag How the extension handler should be forced to update even if the extension - * configuration has not changed. - * @return the next definition stage. - */ - Update withForceUpdateTag(String forceUpdateTag); - } - /** The stage of the Extension update allowing to specify publisher. */ - interface WithPublisher { - /** - * Specifies the publisher property: The name of the extension handler publisher.. - * - * @param publisher The name of the extension handler publisher. - * @return the next definition stage. - */ - Update withPublisher(String publisher); - } - /** The stage of the Extension update allowing to specify typePropertiesType. */ - interface WithTypePropertiesType { - /** - * Specifies the typePropertiesType property: Specifies the type of the extension; an example is - * "CustomScriptExtension".. - * - * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". - * @return the next definition stage. - */ - Update withTypePropertiesType(String typePropertiesType); - } - /** The stage of the Extension update allowing to specify typeHandlerVersion. */ - interface WithTypeHandlerVersion { - /** - * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. - * - * @param typeHandlerVersion Specifies the version of the script handler. - * @return the next definition stage. - */ - Update withTypeHandlerVersion(String typeHandlerVersion); - } - /** The stage of the Extension update allowing to specify autoUpgradeMinorVersion. */ - interface WithAutoUpgradeMinorVersion { - /** - * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor - * version if one is available at deployment time. Once deployed, however, the extension will not upgrade - * minor versions unless redeployed, even with this property set to true.. - * - * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is - * available at deployment time. Once deployed, however, the extension will not upgrade minor versions - * unless redeployed, even with this property set to true. - * @return the next definition stage. - */ - Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); - } - /** The stage of the Extension update allowing to specify settings. */ - interface WithSettings { - /** - * Specifies the settings property: Json formatted public settings for the extension.. - * - * @param settings Json formatted public settings for the extension. - * @return the next definition stage. - */ - Update withSettings(Object settings); - } - /** The stage of the Extension update allowing to specify protectedSettings. */ - interface WithProtectedSettings { - /** - * Specifies the protectedSettings property: Protected settings (may contain secrets).. - * - * @param protectedSettings Protected settings (may contain secrets). - * @return the next definition stage. - */ - Update withProtectedSettings(Object protectedSettings); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Extension refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Extension refresh(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java deleted file mode 100644 index 23c5dfbc409d0..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExtensionAggregateState. */ -public final class ExtensionAggregateState extends ExpandableStringEnum { - /** Static value NotSpecified for ExtensionAggregateState. */ - public static final ExtensionAggregateState NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value Error for ExtensionAggregateState. */ - public static final ExtensionAggregateState ERROR = fromString("Error"); - - /** Static value Succeeded for ExtensionAggregateState. */ - public static final ExtensionAggregateState SUCCEEDED = fromString("Succeeded"); - - /** Static value Canceled for ExtensionAggregateState. */ - public static final ExtensionAggregateState CANCELED = fromString("Canceled"); - - /** Static value Failed for ExtensionAggregateState. */ - public static final ExtensionAggregateState FAILED = fromString("Failed"); - - /** Static value Connected for ExtensionAggregateState. */ - public static final ExtensionAggregateState CONNECTED = fromString("Connected"); - - /** Static value Disconnected for ExtensionAggregateState. */ - public static final ExtensionAggregateState DISCONNECTED = fromString("Disconnected"); - - /** Static value Deleted for ExtensionAggregateState. */ - public static final ExtensionAggregateState DELETED = fromString("Deleted"); - - /** Static value Creating for ExtensionAggregateState. */ - public static final ExtensionAggregateState CREATING = fromString("Creating"); - - /** Static value Updating for ExtensionAggregateState. */ - public static final ExtensionAggregateState UPDATING = fromString("Updating"); - - /** Static value Deleting for ExtensionAggregateState. */ - public static final ExtensionAggregateState DELETING = fromString("Deleting"); - - /** Static value Moving for ExtensionAggregateState. */ - public static final ExtensionAggregateState MOVING = fromString("Moving"); - - /** Static value PartiallySucceeded for ExtensionAggregateState. */ - public static final ExtensionAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); - - /** Static value PartiallyConnected for ExtensionAggregateState. */ - public static final ExtensionAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); - - /** Static value InProgress for ExtensionAggregateState. */ - public static final ExtensionAggregateState IN_PROGRESS = fromString("InProgress"); - - /** - * Creates or finds a ExtensionAggregateState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExtensionAggregateState. - */ - @JsonCreator - public static ExtensionAggregateState fromString(String name) { - return fromString(name, ExtensionAggregateState.class); - } - - /** - * Gets known ExtensionAggregateState values. - * - * @return known ExtensionAggregateState values. - */ - public static Collection values() { - return values(ExtensionAggregateState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java deleted file mode 100644 index 85c724fb57bb2..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Extensions in HCI cluster. */ -@Immutable -public final class ExtensionList { - /* - * List of Extensions in HCI cluster. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of Extensions in HCI cluster. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java new file mode 100644 index 0000000000000..bc82ab72fb53e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image base class. */ +@Immutable +public class GalleryDiskImage { + /* + * This property indicates the size of the VHD to be created. + */ + @JsonProperty(value = "sizeInMB", access = JsonProperty.Access.WRITE_ONLY) + private Long sizeInMB; + + /** Creates an instance of GalleryDiskImage class. */ + public GalleryDiskImage() { + } + + /** + * Get the sizeInMB property: This property indicates the size of the VHD to be created. + * + * @return the sizeInMB value. + */ + public Long sizeInMB() { + return this.sizeInMB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageIdentifier.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageIdentifier.java new file mode 100644 index 0000000000000..abe7f233e9231 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageIdentifier.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the gallery image definition identifier. */ +@Fluent +public final class GalleryImageIdentifier { + /* + * The name of the gallery image definition publisher. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The name of the gallery image definition offer. + */ + @JsonProperty(value = "offer", required = true) + private String offer; + + /* + * The name of the gallery image definition SKU. + */ + @JsonProperty(value = "sku", required = true) + private String sku; + + /** Creates an instance of GalleryImageIdentifier class. */ + public GalleryImageIdentifier() { + } + + /** + * Get the publisher property: The name of the gallery image definition publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the gallery image definition publisher. + * + * @param publisher the publisher value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: The name of the gallery image definition offer. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The name of the gallery image definition offer. + * + * @param offer the offer value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The name of the gallery image definition SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The name of the gallery image definition SKU. + * + * @param sku the sku value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisher() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model GalleryImageIdentifier")); + } + if (offer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); + } + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model GalleryImageIdentifier")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageIdentifier.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatus.java new file mode 100644 index 0000000000000..ace2b72f0b3a5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatus.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of gallery images. */ +@Fluent +public final class GalleryImageStatus { + /* + * GalleryImage provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private GalleryImageStatusProvisioningStatus provisioningStatus; + + /* + * The download status of the gallery image + */ + @JsonProperty(value = "downloadStatus") + private GalleryImageStatusDownloadStatus downloadStatus; + + /* + * The progress of the operation in percentage + */ + @JsonProperty(value = "progressPercentage") + private Long progressPercentage; + + /** Creates an instance of GalleryImageStatus class. */ + public GalleryImageStatus() { + } + + /** + * Get the errorCode property: GalleryImage provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: GalleryImage provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the GalleryImageStatus object itself. + */ + public GalleryImageStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the GalleryImageStatus object itself. + */ + public GalleryImageStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public GalleryImageStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the GalleryImageStatus object itself. + */ + public GalleryImageStatus withProvisioningStatus(GalleryImageStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Get the downloadStatus property: The download status of the gallery image. + * + * @return the downloadStatus value. + */ + public GalleryImageStatusDownloadStatus downloadStatus() { + return this.downloadStatus; + } + + /** + * Set the downloadStatus property: The download status of the gallery image. + * + * @param downloadStatus the downloadStatus value to set. + * @return the GalleryImageStatus object itself. + */ + public GalleryImageStatus withDownloadStatus(GalleryImageStatusDownloadStatus downloadStatus) { + this.downloadStatus = downloadStatus; + return this; + } + + /** + * Get the progressPercentage property: The progress of the operation in percentage. + * + * @return the progressPercentage value. + */ + public Long progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: The progress of the operation in percentage. + * + * @param progressPercentage the progressPercentage value to set. + * @return the GalleryImageStatus object itself. + */ + public GalleryImageStatus withProgressPercentage(Long progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + if (downloadStatus() != null) { + downloadStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusDownloadStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusDownloadStatus.java new file mode 100644 index 0000000000000..9c07cfb904f59 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusDownloadStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The download status of the gallery image. */ +@Fluent +public final class GalleryImageStatusDownloadStatus { + /* + * The downloaded sized of the image in MB + */ + @JsonProperty(value = "downloadSizeInMB") + private Long downloadSizeInMB; + + /** Creates an instance of GalleryImageStatusDownloadStatus class. */ + public GalleryImageStatusDownloadStatus() { + } + + /** + * Get the downloadSizeInMB property: The downloaded sized of the image in MB. + * + * @return the downloadSizeInMB value. + */ + public Long downloadSizeInMB() { + return this.downloadSizeInMB; + } + + /** + * Set the downloadSizeInMB property: The downloaded sized of the image in MB. + * + * @param downloadSizeInMB the downloadSizeInMB value to set. + * @return the GalleryImageStatusDownloadStatus object itself. + */ + public GalleryImageStatusDownloadStatus withDownloadSizeInMB(Long downloadSizeInMB) { + this.downloadSizeInMB = downloadSizeInMB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusProvisioningStatus.java new file mode 100644 index 0000000000000..be6eb2f2b2667 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GalleryImageStatusProvisioningStatus model. */ +@Fluent +public final class GalleryImageStatusProvisioningStatus { + /* + * The ID of the operation performed on the gallery image + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of GalleryImageStatusProvisioningStatus class. */ + public GalleryImageStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the gallery image. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the gallery image. + * + * @param operationId the operationId value to set. + * @return the GalleryImageStatusProvisioningStatus object itself. + */ + public GalleryImageStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the gallery image [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the gallery image [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the GalleryImageStatusProvisioningStatus object itself. + */ + public GalleryImageStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersion.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersion.java new file mode 100644 index 0000000000000..99a99d91ebae4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersion.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImageVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies information about the gallery image version that you want to create or update. */ +@Fluent +public final class GalleryImageVersion { + /* + * This is the version of the gallery image. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private GalleryImageVersionProperties innerProperties; + + /** Creates an instance of GalleryImageVersion class. */ + public GalleryImageVersion() { + } + + /** + * Get the name property: This is the version of the gallery image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: This is the version of the gallery image. + * + * @param name the name value to set. + * @return the GalleryImageVersion object itself. + */ + public GalleryImageVersion withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private GalleryImageVersionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @param storageProfile the storageProfile value to set. + * @return the GalleryImageVersion object itself. + */ + public GalleryImageVersion withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersionStorageProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersionStorageProfile.java new file mode 100644 index 0000000000000..c3c20e35b92bf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersionStorageProfile.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the storage profile of a Gallery Image Version. */ +@Fluent +public final class GalleryImageVersionStorageProfile { + /* + * This is the OS disk image. + */ + @JsonProperty(value = "osDiskImage") + private GalleryOSDiskImage osDiskImage; + + /** Creates an instance of GalleryImageVersionStorageProfile class. */ + public GalleryImageVersionStorageProfile() { + } + + /** + * Get the osDiskImage property: This is the OS disk image. + * + * @return the osDiskImage value. + */ + public GalleryOSDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Set the osDiskImage property: This is the OS disk image. + * + * @param osDiskImage the osDiskImage value to set. + * @return the GalleryImageVersionStorageProfile object itself. + */ + public GalleryImageVersionStorageProfile withOsDiskImage(GalleryOSDiskImage osDiskImage) { + this.osDiskImage = osDiskImage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDiskImage() != null) { + osDiskImage().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImages.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImages.java new file mode 100644 index 0000000000000..15469df7298d0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImages.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import java.util.Map; + +/** An immutable client-side representation of GalleryImages. */ +public interface GalleryImages { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the containerId property: Storage ContainerID of the storage container to be used for gallery image. + * + * @return the containerId value. + */ + String containerId(); + + /** + * Gets the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + String imagePath(); + + /** + * Gets the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + CloudInitDataSource cloudInitDataSource(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + GalleryImageIdentifier identifier(); + + /** + * Gets the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + GalleryImageVersion version(); + + /** + * Gets the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the status property: The observed state of gallery images. + * + * @return the status value. + */ + GalleryImageStatus status(); + + /** + * 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.azurestackhci.fluent.models.GalleryImagesInner object. + * + * @return the inner object. + */ + GalleryImagesInner innerModel(); + + /** The entirety of the GalleryImages definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The GalleryImages definition stages. */ + interface DefinitionStages { + /** The first stage of the GalleryImages definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the GalleryImages 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 GalleryImages 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 GalleryImages 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.WithExtendedLocation, + DefinitionStages.WithContainerId, + DefinitionStages.WithImagePath, + DefinitionStages.WithOsType, + DefinitionStages.WithCloudInitDataSource, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithIdentifier, + DefinitionStages.WithVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + GalleryImages create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GalleryImages create(Context context); + } + + /** The stage of the GalleryImages 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 GalleryImages definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the GalleryImages definition allowing to specify containerId. */ + interface WithContainerId { + /** + * Specifies the containerId property: Storage ContainerID of the storage container to be used for gallery + * image. + * + * @param containerId Storage ContainerID of the storage container to be used for gallery image. + * @return the next definition stage. + */ + WithCreate withContainerId(String containerId); + } + + /** The stage of the GalleryImages definition allowing to specify imagePath. */ + interface WithImagePath { + /** + * Specifies the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath location of the image the gallery image should be created from. + * @return the next definition stage. + */ + WithCreate withImagePath(String imagePath); + } + + /** The stage of the GalleryImages definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType Operating system type that the gallery image uses [Windows, Linux]. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** The stage of the GalleryImages definition allowing to specify cloudInitDataSource. */ + interface WithCloudInitDataSource { + /** + * Specifies the cloudInitDataSource property: Datasource for the gallery image when provisioning with + * cloud-init [NoCloud, Azure]. + * + * @param cloudInitDataSource Datasource for the gallery image when provisioning with cloud-init [NoCloud, + * Azure]. + * @return the next definition stage. + */ + WithCreate withCloudInitDataSource(CloudInitDataSource cloudInitDataSource); + } + + /** The stage of the GalleryImages definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2]. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + + /** The stage of the GalleryImages definition allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: This is the gallery image definition identifier.. + * + * @param identifier This is the gallery image definition identifier. + * @return the next definition stage. + */ + WithCreate withIdentifier(GalleryImageIdentifier identifier); + } + + /** The stage of the GalleryImages definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Specifies information about the gallery image version that you want to + * create or update.. + * + * @param version Specifies information about the gallery image version that you want to create or update. + * @return the next definition stage. + */ + WithCreate withVersion(GalleryImageVersion version); + } + } + + /** + * Begins update for the GalleryImages resource. + * + * @return the stage of resource update. + */ + GalleryImages.Update update(); + + /** The template for GalleryImages update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GalleryImages apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GalleryImages apply(Context context); + } + + /** The GalleryImages update stages. */ + interface UpdateStages { + /** The stage of the GalleryImages update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GalleryImages refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GalleryImages refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesListResult.java similarity index 66% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesListResult.java index 0a18e044fdbff..d7b45e6f388a0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of clusters. */ +/** List of gallery images. */ @Fluent -public final class ClusterList { +public final class GalleryImagesListResult { /* - * List of clusters. + * The value property. */ @JsonProperty(value = "value") - private List value; + private List value; /* * Link to the next set of results. @@ -24,22 +24,26 @@ public final class ClusterList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of GalleryImagesListResult class. */ + public GalleryImagesListResult() { + } + /** - * Get the value property: List of clusters. + * Get the value property: The value property. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of clusters. + * Set the value property: The value property. * * @param value the value value to set. - * @return the ClusterList object itself. + * @return the GalleryImagesListResult object itself. */ - public ClusterList withValue(List value) { + public GalleryImagesListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.java similarity index 58% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.java index bc901c68316ac..03a4b0103bb52 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.java @@ -8,119 +8,129 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Extensions. */ -public interface Extensions { +/** Resource collection API of GalleryImagesOperations. */ +public interface GalleryImagesOperations { /** - * List all Extensions under ArcSetting resource. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param galleryImageName Name of the gallery image. + * @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 list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + * @return a gallery image along with {@link Response}. */ - PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryImageName, Context context); /** - * List all Extensions under ArcSetting resource. + * Gets a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. + * @param galleryImageName Name of the gallery image. * @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 list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + * @return a gallery image. */ - PagedIterable listByArcSetting( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + GalleryImages getByResourceGroup(String resourceGroupName, String galleryImageName); /** - * Get particular Arc Extension of HCI Cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param galleryImageName Name of the gallery image. * @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 particular Arc Extension of HCI Cluster. */ - Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + void deleteByResourceGroup(String resourceGroupName, String galleryImageName); /** - * Get particular Arc Extension of HCI Cluster. + * The operation to delete a gallery image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. + * @param galleryImageName Name of the gallery image. * @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 particular Arc Extension of HCI Cluster along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + void delete(String resourceGroupName, String galleryImageName, Context context); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @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 list of gallery images as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Delete particular Arc Extension of HCI Cluster. + * Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get + * the next page of gallery images. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param extensionName The name of the machine extension. * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get + * the next page of gallery images. + * + * @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 list of gallery images as paginated response with {@link PagedIterable}. */ - void delete( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + PagedIterable list(Context context); /** - * Get particular Arc Extension of HCI Cluster. + * Gets a gallery image. * * @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 particular Arc Extension of HCI Cluster along with {@link Response}. + * @return a gallery image along with {@link Response}. */ - Extension getById(String id); + GalleryImages getById(String id); /** - * Get particular Arc Extension of HCI Cluster. + * Gets a gallery image. * * @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 particular Arc Extension of HCI Cluster along with {@link Response}. + * @return a gallery image along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete particular Arc Extension of HCI Cluster. + * The operation to delete a gallery image. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -130,7 +140,7 @@ void delete( void deleteById(String id); /** - * Delete particular Arc Extension of HCI Cluster. + * The operation to delete a gallery image. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -141,10 +151,10 @@ void delete( void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new Extension resource. + * Begins definition for a new GalleryImages resource. * * @param name resource name. - * @return the first stage of the new Extension definition. + * @return the first stage of the new GalleryImages definition. */ - Extension.DefinitionStages.Blank define(String name); + GalleryImages.DefinitionStages.Blank define(String name); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesUpdateRequest.java new file mode 100644 index 0000000000000..b1a470b1eb6bf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The gallery images resource patch definition. */ +@Fluent +public final class GalleryImagesUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of GalleryImagesUpdateRequest class. */ + public GalleryImagesUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the GalleryImagesUpdateRequest object itself. + */ + public GalleryImagesUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java new file mode 100644 index 0000000000000..ea35ace9757d3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; + +/** This is the OS disk image. */ +@Immutable +public final class GalleryOSDiskImage extends GalleryDiskImage { + /** Creates an instance of GalleryOSDiskImage class. */ + public GalleryOSDiskImage() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgent.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgent.java new file mode 100644 index 0000000000000..b7986399f1432 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgent.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; + +/** An immutable client-side representation of GuestAgent. */ +public interface GuestAgent { + /** + * 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 credentials property: Username / Password Credentials to provision guest agent. + * + * @return the credentials value. + */ + GuestCredential credentials(); + + /** + * Gets the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @return the httpProxyConfig value. + */ + HttpProxyConfiguration httpProxyConfig(); + + /** + * Gets the provisioningAction property: The guest agent provisioning action. + * + * @return the provisioningAction value. + */ + ProvisioningAction provisioningAction(); + + /** + * Gets the status property: The guest agent status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner object. + * + * @return the inner object. + */ + GuestAgentInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentInstallStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentInstallStatus.java new file mode 100644 index 0000000000000..69050f0880e6a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentInstallStatus.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Defines the status of a guest agent installation. */ +@Immutable +public final class GuestAgentInstallStatus { + /* + * Specifies the VM's unique SMBIOS ID. + */ + @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) + private String vmUuid; + + /* + * The installation status of the hybrid machine agent installation. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /* + * The time of the last status change. + */ + @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStatusChange; + + /* + * The hybrid machine agent full version. + */ + @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /* + * Details about the error state. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** Creates an instance of GuestAgentInstallStatus class. */ + public GuestAgentInstallStatus() { + } + + /** + * Get the vmUuid property: Specifies the VM's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + public String vmUuid() { + return this.vmUuid; + } + + /** + * Get the status property: The installation status of the hybrid machine agent installation. + * + * @return the status value. + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentList.java new file mode 100644 index 0000000000000..6f8fcd6d360a1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of GuestAgent. */ +@Fluent +public final class GuestAgentList { + /* + * Url to follow for getting next page of GuestAgent. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Array of GuestAgent + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** Creates an instance of GuestAgentList class. */ + public GuestAgentList() { + } + + /** + * Get the nextLink property: Url to follow for getting next page of GuestAgent. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of GuestAgent. + * + * @param nextLink the nextLink value to set. + * @return the GuestAgentList object itself. + */ + public GuestAgentList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Array of GuestAgent. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of GuestAgent. + * + * @param value the value value to set. + * @return the GuestAgentList object itself. + */ + public GuestAgentList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model GuestAgentList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentList.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgents.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgents.java new file mode 100644 index 0000000000000..5f021fd47ad13 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgents.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; + +/** Resource collection API of GuestAgents. */ +public interface GuestAgents { + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent. + */ + GuestAgent create(String resourceUri); + + /** + * Implements GuestAgent PUT method. + * + *

Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 defines the GuestAgent. + */ + GuestAgent create(String resourceUri, GuestAgentInner body, Context context); + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets GuestAgent. + * + *

Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent. + */ + GuestAgent get(String resourceUri); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * Deleted an GuestAgent. + * + *

Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentsOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentsOperations.java new file mode 100644 index 0000000000000..0269e3f058d7b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentsOperations.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of GuestAgentsOperations. */ +public interface GuestAgentsOperations { + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Implements GET GuestAgent in a vm. + * + *

Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of GuestAgent as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestCredential.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestCredential.java new file mode 100644 index 0000000000000..4726ec54b76d6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestCredential.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Username / Password Credentials to connect to guest. */ +@Fluent +public final class GuestCredential { + /* + * The username to connect with the guest. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password to connect with the guest. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of GuestCredential class. */ + public GuestCredential() { + } + + /** + * Get the username property: The username to connect with the guest. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username to connect with the guest. + * + * @param username the username value to set. + * @return the GuestCredential object itself. + */ + public GuestCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password to connect with the guest. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password to connect with the guest. + * + * @param password the password value to set. + * @return the GuestCredential object itself. + */ + public GuestCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java new file mode 100644 index 0000000000000..50605acb81d8d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ +@Fluent +public final class HardwareProfileUpdate { + /* + * The vmSize property. + */ + @JsonProperty(value = "vmSize") + private VmSizeEnum vmSize; + + /* + * number of processors for the virtual machine instance + */ + @JsonProperty(value = "processors") + private Integer processors; + + /* + * RAM in MB for the virtual machine instance + */ + @JsonProperty(value = "memoryMB") + private Long memoryMB; + + /** Creates an instance of HardwareProfileUpdate class. */ + public HardwareProfileUpdate() { + } + + /** + * Get the vmSize property: The vmSize property. + * + * @return the vmSize value. + */ + public VmSizeEnum vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The vmSize property. + * + * @param vmSize the vmSize value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withVmSize(VmSizeEnum vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the processors property: number of processors for the virtual machine instance. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: number of processors for the virtual machine instance. + * + * @param processors the processors value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Get the memoryMB property: RAM in MB for the virtual machine instance. + * + * @return the memoryMB value. + */ + public Long memoryMB() { + return this.memoryMB; + } + + /** + * Set the memoryMB property: RAM in MB for the virtual machine instance. + * + * @param memoryMB the memoryMB value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withMemoryMB(Long memoryMB) { + this.memoryMB = memoryMB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HttpProxyConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HttpProxyConfiguration.java new file mode 100644 index 0000000000000..86cf3a13667ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HttpProxyConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HTTP Proxy configuration for the VM. */ +@Fluent +public final class HttpProxyConfiguration { + /* + * The httpsProxy url. + */ + @JsonProperty(value = "httpsProxy") + private String httpsProxy; + + /** Creates an instance of HttpProxyConfiguration class. */ + public HttpProxyConfiguration() { + } + + /** + * Get the httpsProxy property: The httpsProxy url. + * + * @return the httpsProxy value. + */ + public String httpsProxy() { + return this.httpsProxy; + } + + /** + * Set the httpsProxy property: The httpsProxy url. + * + * @param httpsProxy the httpsProxy value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withHttpsProxy(String httpsProxy) { + this.httpsProxy = httpsProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadata.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadata.java new file mode 100644 index 0000000000000..5cbac5907b4f5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadata.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; + +/** An immutable client-side representation of HybridIdentityMetadata. */ +public interface HybridIdentityMetadata { + /** + * 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 resourceUid property: The unique identifier for the resource. + * + * @return the resourceUid value. + */ + String resourceUid(); + + /** + * Gets the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner object. + * + * @return the inner object. + */ + HybridIdentityMetadataInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadataList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadataList.java new file mode 100644 index 0000000000000..f42f2d10f731a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadataList.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HybridIdentityMetadata. */ +@Fluent +public final class HybridIdentityMetadataList { + /* + * Url to follow for getting next page of HybridIdentityMetadata. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Array of HybridIdentityMetadata + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** Creates an instance of HybridIdentityMetadataList class. */ + public HybridIdentityMetadataList() { + } + + /** + * Get the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. + * + * @param nextLink the nextLink value to set. + * @return the HybridIdentityMetadataList object itself. + */ + public HybridIdentityMetadataList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Array of HybridIdentityMetadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of HybridIdentityMetadata. + * + * @param value the value value to set. + * @return the HybridIdentityMetadataList object itself. + */ + public HybridIdentityMetadataList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model HybridIdentityMetadataList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataList.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadatas.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadatas.java new file mode 100644 index 0000000000000..0b5b161650438 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadatas.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 HybridIdentityMetadatas. */ +public interface HybridIdentityMetadatas { + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata. + */ + HybridIdentityMetadata get(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HyperVGeneration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HyperVGeneration.java new file mode 100644 index 0000000000000..e5f05fad85dab --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HyperVGeneration.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The hypervisor generation of the Virtual Machine [V1, V2]. */ +public final class HyperVGeneration extends ExpandableStringEnum { + /** Static value V1 for HyperVGeneration. */ + public static final HyperVGeneration V1 = fromString("V1"); + + /** Static value V2 for HyperVGeneration. */ + public static final HyperVGeneration V2 = fromString("V2"); + + /** + * Creates a new instance of HyperVGeneration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HyperVGeneration() { + } + + /** + * Creates or finds a HyperVGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVGeneration. + */ + @JsonCreator + public static HyperVGeneration fromString(String name) { + return fromString(name, HyperVGeneration.class); + } + + /** + * Gets known HyperVGeneration values. + * + * @return known HyperVGeneration values. + */ + public static Collection values() { + return values(HyperVGeneration.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Identity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Identity.java new file mode 100644 index 0000000000000..0f80a93fb7cf0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Identity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity for the resource. */ +@Fluent +public final class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** Creates an instance of Identity class. */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java deleted file mode 100644 index c3ca4a6a0bcfe..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ImdsAttestation. */ -public final class ImdsAttestation extends ExpandableStringEnum { - /** Static value Disabled for ImdsAttestation. */ - public static final ImdsAttestation DISABLED = fromString("Disabled"); - - /** Static value Enabled for ImdsAttestation. */ - public static final ImdsAttestation ENABLED = fromString("Enabled"); - - /** - * Creates or finds a ImdsAttestation from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImdsAttestation. - */ - @JsonCreator - public static ImdsAttestation fromString(String name) { - return fromString(name, ImdsAttestation.class); - } - - /** - * Gets known ImdsAttestation values. - * - * @return known ImdsAttestation values. - */ - public static Collection values() { - return values(ImdsAttestation.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InstanceViewStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InstanceViewStatus.java new file mode 100644 index 0000000000000..55ebed95826c8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InstanceViewStatus.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class InstanceViewStatus { + /* + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time") + private OffsetDateTime time; + + /** Creates an instance of InstanceViewStatus class. */ + public InstanceViewStatus() { + } + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The status code. + * + * @param code the code value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the displayStatus property: The short localizable label for the status. + * + * @param displayStatus the displayStatus value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The detailed status message, including for alerts and error messages. + * + * @param message the message value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time of the status. + * + * @param time the time value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java new file mode 100644 index 0000000000000..5020b815a6798 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The InterfaceDnsSettings model. */ +@Fluent +public final class InterfaceDnsSettings { + /* + * List of DNS server IP Addresses for the interface + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** Creates an instance of InterfaceDnsSettings class. */ + public InterfaceDnsSettings() { + } + + /** + * Get the dnsServers property: List of DNS server IP Addresses for the interface. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS server IP Addresses for the interface. + * + * @param dnsServers the dnsServers value to set. + * @return the InterfaceDnsSettings object itself. + */ + public InterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpAllocationMethodEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpAllocationMethodEnum.java new file mode 100644 index 0000000000000..372b2b2b943a1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpAllocationMethodEnum.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic'. */ +public final class IpAllocationMethodEnum extends ExpandableStringEnum { + /** Static value Dynamic for IpAllocationMethodEnum. */ + public static final IpAllocationMethodEnum DYNAMIC = fromString("Dynamic"); + + /** Static value Static for IpAllocationMethodEnum. */ + public static final IpAllocationMethodEnum STATIC = fromString("Static"); + + /** + * Creates a new instance of IpAllocationMethodEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAllocationMethodEnum() { + } + + /** + * Creates or finds a IpAllocationMethodEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationMethodEnum. + */ + @JsonCreator + public static IpAllocationMethodEnum fromString(String name) { + return fromString(name, IpAllocationMethodEnum.class); + } + + /** + * Gets known IpAllocationMethodEnum values. + * + * @return known IpAllocationMethodEnum values. + */ + public static Collection values() { + return values(IpAllocationMethodEnum.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java new file mode 100644 index 0000000000000..08f62574c41c1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InterfaceIPConfiguration iPConfiguration in a network interface. */ +@Fluent +public final class IpConfiguration { + /* + * Name - The name of the resource that is unique within a resource group. This name can be used to access the + * resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + */ + @JsonProperty(value = "properties") + private IpConfigurationProperties properties; + + /** Creates an instance of IpConfiguration class. */ + public IpConfiguration() { + } + + /** + * Get the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @param name the name value to set. + * @return the IpConfiguration object itself. + */ + public IpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + * + * @return the properties value. + */ + public IpConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + * + * @param properties the properties value to set. + * @return the IpConfiguration object itself. + */ + public IpConfiguration withProperties(IpConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java new file mode 100644 index 0000000000000..cfd23e8f1ea7c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InterfaceIPConfigurationPropertiesFormat properties of IP configuration. */ +@Fluent +public final class IpConfigurationProperties { + /* + * Gateway for network interface + */ + @JsonProperty(value = "gateway") + private String gateway; + + /* + * prefixLength for network interface + */ + @JsonProperty(value = "prefixLength") + private String prefixLength; + + /* + * PrivateIPAddress - Private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * Subnet - Name of Subnet bound to the IP configuration. + */ + @JsonProperty(value = "subnet") + private IpConfigurationPropertiesSubnet subnet; + + /** Creates an instance of IpConfigurationProperties class. */ + public IpConfigurationProperties() { + } + + /** + * Get the gateway property: Gateway for network interface. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway property: Gateway for network interface. + * + * @param gateway the gateway value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the prefixLength property: prefixLength for network interface. + * + * @return the prefixLength value. + */ + public String prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: prefixLength for network interface. + * + * @param prefixLength the prefixLength value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withPrefixLength(String prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the privateIpAddress property: PrivateIPAddress - Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: PrivateIPAddress - Private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the subnet property: Subnet - Name of Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + public IpConfigurationPropertiesSubnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet - Name of Subnet bound to the IP configuration. + * + * @param subnet the subnet value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withSubnet(IpConfigurationPropertiesSubnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java new file mode 100644 index 0000000000000..3fb374bdaaedf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Subnet - Name of Subnet bound to the IP configuration. */ +@Fluent +public final class IpConfigurationPropertiesSubnet { + /* + * ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of IpConfigurationPropertiesSubnet class. */ + public IpConfigurationPropertiesSubnet() { + } + + /** + * Get the id property: ID - The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param id the id value to set. + * @return the IpConfigurationPropertiesSubnet object itself. + */ + public IpConfigurationPropertiesSubnet withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatus.java new file mode 100644 index 0000000000000..cc7bf491fedda --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatus.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of marketplace gallery images. */ +@Fluent +public final class MarketplaceGalleryImageStatus { + /* + * MarketplaceGalleryImage provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus; + + /* + * The download status of the gallery image + */ + @JsonProperty(value = "downloadStatus") + private MarketplaceGalleryImageStatusDownloadStatus downloadStatus; + + /* + * The progress of the operation in percentage + */ + @JsonProperty(value = "progressPercentage") + private Long progressPercentage; + + /** Creates an instance of MarketplaceGalleryImageStatus class. */ + public MarketplaceGalleryImageStatus() { + } + + /** + * Get the errorCode property: MarketplaceGalleryImage provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: MarketplaceGalleryImage provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the MarketplaceGalleryImageStatus object itself. + */ + public MarketplaceGalleryImageStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MarketplaceGalleryImageStatus object itself. + */ + public MarketplaceGalleryImageStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the MarketplaceGalleryImageStatus object itself. + */ + public MarketplaceGalleryImageStatus withProvisioningStatus( + MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Get the downloadStatus property: The download status of the gallery image. + * + * @return the downloadStatus value. + */ + public MarketplaceGalleryImageStatusDownloadStatus downloadStatus() { + return this.downloadStatus; + } + + /** + * Set the downloadStatus property: The download status of the gallery image. + * + * @param downloadStatus the downloadStatus value to set. + * @return the MarketplaceGalleryImageStatus object itself. + */ + public MarketplaceGalleryImageStatus withDownloadStatus( + MarketplaceGalleryImageStatusDownloadStatus downloadStatus) { + this.downloadStatus = downloadStatus; + return this; + } + + /** + * Get the progressPercentage property: The progress of the operation in percentage. + * + * @return the progressPercentage value. + */ + public Long progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: The progress of the operation in percentage. + * + * @param progressPercentage the progressPercentage value to set. + * @return the MarketplaceGalleryImageStatus object itself. + */ + public MarketplaceGalleryImageStatus withProgressPercentage(Long progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + if (downloadStatus() != null) { + downloadStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusDownloadStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusDownloadStatus.java new file mode 100644 index 0000000000000..8c3c82f2506e8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusDownloadStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The download status of the gallery image. */ +@Fluent +public final class MarketplaceGalleryImageStatusDownloadStatus { + /* + * The downloaded sized of the image in MB + */ + @JsonProperty(value = "downloadSizeInMB") + private Long downloadSizeInMB; + + /** Creates an instance of MarketplaceGalleryImageStatusDownloadStatus class. */ + public MarketplaceGalleryImageStatusDownloadStatus() { + } + + /** + * Get the downloadSizeInMB property: The downloaded sized of the image in MB. + * + * @return the downloadSizeInMB value. + */ + public Long downloadSizeInMB() { + return this.downloadSizeInMB; + } + + /** + * Set the downloadSizeInMB property: The downloaded sized of the image in MB. + * + * @param downloadSizeInMB the downloadSizeInMB value to set. + * @return the MarketplaceGalleryImageStatusDownloadStatus object itself. + */ + public MarketplaceGalleryImageStatusDownloadStatus withDownloadSizeInMB(Long downloadSizeInMB) { + this.downloadSizeInMB = downloadSizeInMB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusProvisioningStatus.java new file mode 100644 index 0000000000000..0fdf25ef0dfb7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MarketplaceGalleryImageStatusProvisioningStatus model. */ +@Fluent +public final class MarketplaceGalleryImageStatusProvisioningStatus { + /* + * The ID of the operation performed on the gallery image + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of MarketplaceGalleryImageStatusProvisioningStatus class. */ + public MarketplaceGalleryImageStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the gallery image. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the gallery image. + * + * @param operationId the operationId value to set. + * @return the MarketplaceGalleryImageStatusProvisioningStatus object itself. + */ + public MarketplaceGalleryImageStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the gallery image [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the gallery image [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the MarketplaceGalleryImageStatusProvisioningStatus object itself. + */ + public MarketplaceGalleryImageStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImages.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImages.java new file mode 100644 index 0000000000000..fe0fa8796d075 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImages.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import java.util.Map; + +/** An immutable client-side representation of MarketplaceGalleryImages. */ +public interface MarketplaceGalleryImages { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery + * image. + * + * @return the containerId value. + */ + String containerId(); + + /** + * Gets the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init + * [NoCloud, Azure]. + * + * @return the cloudInitDataSource value. + */ + CloudInitDataSource cloudInitDataSource(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + GalleryImageIdentifier identifier(); + + /** + * Gets the version property: Specifies information about the gallery image version that you want to create or + * update. + * + * @return the version value. + */ + GalleryImageVersion version(); + + /** + * Gets the provisioningState property: Provisioning state of the marketplace gallery image. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the status property: The observed state of marketplace gallery images. + * + * @return the status value. + */ + MarketplaceGalleryImageStatus status(); + + /** + * 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.azurestackhci.fluent.models.MarketplaceGalleryImagesInner object. + * + * @return the inner object. + */ + MarketplaceGalleryImagesInner innerModel(); + + /** The entirety of the MarketplaceGalleryImages definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The MarketplaceGalleryImages definition stages. */ + interface DefinitionStages { + /** The first stage of the MarketplaceGalleryImages definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the MarketplaceGalleryImages 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 MarketplaceGalleryImages 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 MarketplaceGalleryImages 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.WithExtendedLocation, + DefinitionStages.WithContainerId, + DefinitionStages.WithOsType, + DefinitionStages.WithCloudInitDataSource, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithIdentifier, + DefinitionStages.WithVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + MarketplaceGalleryImages create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MarketplaceGalleryImages create(Context context); + } + + /** The stage of the MarketplaceGalleryImages 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 MarketplaceGalleryImages definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify containerId. */ + interface WithContainerId { + /** + * Specifies the containerId property: Storage ContainerID of the storage container to be used for + * marketplace gallery image. + * + * @param containerId Storage ContainerID of the storage container to be used for marketplace gallery image. + * @return the next definition stage. + */ + WithCreate withContainerId(String containerId); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: Operating system type that the gallery image uses [Windows, Linux]. + * + * @param osType Operating system type that the gallery image uses [Windows, Linux]. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify cloudInitDataSource. */ + interface WithCloudInitDataSource { + /** + * Specifies the cloudInitDataSource property: Datasource for the gallery image when provisioning with + * cloud-init [NoCloud, Azure]. + * + * @param cloudInitDataSource Datasource for the gallery image when provisioning with cloud-init [NoCloud, + * Azure]. + * @return the next definition stage. + */ + WithCreate withCloudInitDataSource(CloudInitDataSource cloudInitDataSource); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2]. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: This is the gallery image definition identifier.. + * + * @param identifier This is the gallery image definition identifier. + * @return the next definition stage. + */ + WithCreate withIdentifier(GalleryImageIdentifier identifier); + } + + /** The stage of the MarketplaceGalleryImages definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Specifies information about the gallery image version that you want to + * create or update.. + * + * @param version Specifies information about the gallery image version that you want to create or update. + * @return the next definition stage. + */ + WithCreate withVersion(GalleryImageVersion version); + } + } + + /** + * Begins update for the MarketplaceGalleryImages resource. + * + * @return the stage of resource update. + */ + MarketplaceGalleryImages.Update update(); + + /** The template for MarketplaceGalleryImages update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MarketplaceGalleryImages apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MarketplaceGalleryImages apply(Context context); + } + + /** The MarketplaceGalleryImages update stages. */ + interface UpdateStages { + /** The stage of the MarketplaceGalleryImages update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MarketplaceGalleryImages refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MarketplaceGalleryImages refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesListResult.java new file mode 100644 index 0000000000000..4d83afc25681b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MarketplaceGalleryImagesListResult model. */ +@Fluent +public final class MarketplaceGalleryImagesListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of MarketplaceGalleryImagesListResult class. */ + public MarketplaceGalleryImagesListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MarketplaceGalleryImagesListResult object itself. + */ + public MarketplaceGalleryImagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the MarketplaceGalleryImagesListResult object itself. + */ + public MarketplaceGalleryImagesListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesOperations.java new file mode 100644 index 0000000000000..1df4078381485 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesOperations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 MarketplaceGalleryImagesOperations. */ +public interface MarketplaceGalleryImagesOperations { + /** + * Gets a marketplace gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 marketplace gallery image along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String marketplaceGalleryImageName, Context context); + + /** + * Gets a marketplace gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 marketplace gallery image. + */ + MarketplaceGalleryImages getByResourceGroup(String resourceGroupName, String marketplaceGalleryImageName); + + /** + * The operation to delete a marketplace gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @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 marketplaceGalleryImageName); + + /** + * The operation to delete a marketplace gallery image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param marketplaceGalleryImageName Name of the marketplace gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String marketplaceGalleryImageName, Context context); + + /** + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the + * response to get the next page of marketplace gallery images. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a marketplace gallery image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a marketplace gallery image along with {@link Response}. + */ + MarketplaceGalleryImages getById(String id); + + /** + * Gets a marketplace gallery image. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a marketplace gallery image along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a marketplace gallery image. + * + * @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); + + /** + * The operation to delete a marketplace gallery image. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MarketplaceGalleryImages resource. + * + * @param name resource name. + * @return the first stage of the new MarketplaceGalleryImages definition. + */ + MarketplaceGalleryImages.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesUpdateRequest.java new file mode 100644 index 0000000000000..f519104410bb4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The marketplace gallery image resource patch definition. */ +@Fluent +public final class MarketplaceGalleryImagesUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of MarketplaceGalleryImagesUpdateRequest class. */ + public MarketplaceGalleryImagesUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the MarketplaceGalleryImagesUpdateRequest object itself. + */ + public MarketplaceGalleryImagesUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatus.java new file mode 100644 index 0000000000000..b4c2e0201454b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatus.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of network interfaces. */ +@Fluent +public final class NetworkInterfaceStatus { + /* + * NetworkInterface provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private NetworkInterfaceStatusProvisioningStatus provisioningStatus; + + /** Creates an instance of NetworkInterfaceStatus class. */ + public NetworkInterfaceStatus() { + } + + /** + * Get the errorCode property: NetworkInterface provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: NetworkInterface provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the NetworkInterfaceStatus object itself. + */ + public NetworkInterfaceStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the NetworkInterfaceStatus object itself. + */ + public NetworkInterfaceStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public NetworkInterfaceStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the NetworkInterfaceStatus object itself. + */ + public NetworkInterfaceStatus withProvisioningStatus(NetworkInterfaceStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatusProvisioningStatus.java new file mode 100644 index 0000000000000..648f20e05edad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkInterfaceStatusProvisioningStatus model. */ +@Fluent +public final class NetworkInterfaceStatusProvisioningStatus { + /* + * The ID of the operation performed on the network interface + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the network interface [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of NetworkInterfaceStatusProvisioningStatus class. */ + public NetworkInterfaceStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the network interface. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the network interface. + * + * @param operationId the operationId value to set. + * @return the NetworkInterfaceStatusProvisioningStatus object itself. + */ + public NetworkInterfaceStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the network interface [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the network interface [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the NetworkInterfaceStatusProvisioningStatus object itself. + */ + public NetworkInterfaceStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaces.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaces.java new file mode 100644 index 0000000000000..1e464fcbcdab2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaces.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkInterfaces. */ +public interface NetworkInterfaces { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + String macAddress(); + + /** + * Gets the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + InterfaceDnsSettings dnsSettings(); + + /** + * Gets the provisioningState property: Provisioning state of the network interface. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the status property: The observed state of network interfaces. + * + * @return the status value. + */ + NetworkInterfaceStatus status(); + + /** + * 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.azurestackhci.fluent.models.NetworkInterfacesInner object. + * + * @return the inner object. + */ + NetworkInterfacesInner innerModel(); + + /** The entirety of the NetworkInterfaces definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The NetworkInterfaces definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterfaces definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the NetworkInterfaces 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 NetworkInterfaces 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 NetworkInterfaces 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.WithExtendedLocation, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithMacAddress, + DefinitionStages.WithDnsSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterfaces create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterfaces create(Context context); + } + + /** The stage of the NetworkInterfaces 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 NetworkInterfaces definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the NetworkInterfaces definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network + * interface.. + * + * @param ipConfigurations IPConfigurations - A list of IPConfigurations of the network interface. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** The stage of the NetworkInterfaces definition allowing to specify macAddress. */ + interface WithMacAddress { + /** + * Specifies the macAddress property: MacAddress - The MAC address of the network interface.. + * + * @param macAddress MacAddress - The MAC address of the network interface. + * @return the next definition stage. + */ + WithCreate withMacAddress(String macAddress); + } + + /** The stage of the NetworkInterfaces definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings DNS Settings for the interface. + * @return the next definition stage. + */ + WithCreate withDnsSettings(InterfaceDnsSettings dnsSettings); + } + } + + /** + * Begins update for the NetworkInterfaces resource. + * + * @return the stage of resource update. + */ + NetworkInterfaces.Update update(); + + /** The template for NetworkInterfaces update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterfaces apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterfaces apply(Context context); + } + + /** The NetworkInterfaces update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterfaces update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterfaces refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterfaces refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesListResult.java new file mode 100644 index 0000000000000..4493cdeae4d09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NetworkInterfacesListResult model. */ +@Fluent +public final class NetworkInterfacesListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkInterfacesListResult class. */ + public NetworkInterfacesListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NetworkInterfacesListResult object itself. + */ + public NetworkInterfacesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NetworkInterfacesListResult object itself. + */ + public NetworkInterfacesListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesOperations.java new file mode 100644 index 0000000000000..930366df5ebea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesOperations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 NetworkInterfacesOperations. */ +public interface NetworkInterfacesOperations { + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 network interface along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 network interface. + */ + NetworkInterfaces getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @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 networkInterfaceName); + + /** + * The operation to delete a network interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkInterfaceName Name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to + * get the next page of network interfaces. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a network interface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface along with {@link Response}. + */ + NetworkInterfaces getById(String id); + + /** + * Gets a network interface. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a network interface. + * + * @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); + + /** + * The operation to delete a network interface. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkInterfaces resource. + * + * @param name resource name. + * @return the first stage of the new NetworkInterfaces definition. + */ + NetworkInterfaces.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesUpdateRequest.java new file mode 100644 index 0000000000000..b5370c24c46db --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The network interface resource patch definition. */ +@Fluent +public final class NetworkInterfacesUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of NetworkInterfacesUpdateRequest class. */ + public NetworkInterfacesUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NetworkInterfacesUpdateRequest object itself. + */ + public NetworkInterfacesUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.java new file mode 100644 index 0000000000000..888e4bd5cdc49 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkProfile - describes the network update configuration the virtual machine instance. */ +@Fluent +public final class NetworkProfileUpdate { + /* + * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** Creates an instance of NetworkProfileUpdate class. */ + public NetworkProfileUpdate() { + } + + /** + * Get the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine instance. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine instance. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfileUpdate object itself. + */ + public NetworkProfileUpdate withNetworkInterfaces( + List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java new file mode 100644 index 0000000000000..7114a92fa8b6f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkProfileUpdateNetworkInterfacesItem model. */ +@Fluent +public final class NetworkProfileUpdateNetworkInterfacesItem { + /* + * ID - Resource ID of the network interface + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of NetworkProfileUpdateNetworkInterfacesItem class. */ + public NetworkProfileUpdateNetworkInterfacesItem() { + } + + /** + * Get the id property: ID - Resource ID of the network interface. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - Resource ID of the network interface. + * + * @param id the id value to set. + * @return the NetworkProfileUpdateNetworkInterfacesItem object itself. + */ + public NetworkProfileUpdateNetworkInterfacesItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkTypeEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkTypeEnum.java new file mode 100644 index 0000000000000..3b0cdc277cefc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkTypeEnum.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the network. */ +public final class NetworkTypeEnum extends ExpandableStringEnum { + /** Static value NAT for NetworkTypeEnum. */ + public static final NetworkTypeEnum NAT = fromString("NAT"); + + /** Static value Transparent for NetworkTypeEnum. */ + public static final NetworkTypeEnum TRANSPARENT = fromString("Transparent"); + + /** Static value L2Bridge for NetworkTypeEnum. */ + public static final NetworkTypeEnum L2BRIDGE = fromString("L2Bridge"); + + /** Static value L2Tunnel for NetworkTypeEnum. */ + public static final NetworkTypeEnum L2TUNNEL = fromString("L2Tunnel"); + + /** Static value ICS for NetworkTypeEnum. */ + public static final NetworkTypeEnum ICS = fromString("ICS"); + + /** Static value Private for NetworkTypeEnum. */ + public static final NetworkTypeEnum PRIVATE = fromString("Private"); + + /** Static value Overlay for NetworkTypeEnum. */ + public static final NetworkTypeEnum OVERLAY = fromString("Overlay"); + + /** Static value Internal for NetworkTypeEnum. */ + public static final NetworkTypeEnum INTERNAL = fromString("Internal"); + + /** Static value Mirrored for NetworkTypeEnum. */ + public static final NetworkTypeEnum MIRRORED = fromString("Mirrored"); + + /** + * Creates a new instance of NetworkTypeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkTypeEnum() { + } + + /** + * Creates or finds a NetworkTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkTypeEnum. + */ + @JsonCreator + public static NetworkTypeEnum fromString(String name) { + return fromString(name, NetworkTypeEnum.class); + } + + /** + * Gets known NetworkTypeEnum values. + * + * @return known NetworkTypeEnum values. + */ + public static Collection values() { + return values(NetworkTypeEnum.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java deleted file mode 100644 index c4f967773edf3..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java +++ /dev/null @@ -1,68 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NodeArcState. */ -public final class NodeArcState extends ExpandableStringEnum { - /** Static value NotSpecified for NodeArcState. */ - public static final NodeArcState NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value Error for NodeArcState. */ - public static final NodeArcState ERROR = fromString("Error"); - - /** Static value Succeeded for NodeArcState. */ - public static final NodeArcState SUCCEEDED = fromString("Succeeded"); - - /** Static value Canceled for NodeArcState. */ - public static final NodeArcState CANCELED = fromString("Canceled"); - - /** Static value Failed for NodeArcState. */ - public static final NodeArcState FAILED = fromString("Failed"); - - /** Static value Connected for NodeArcState. */ - public static final NodeArcState CONNECTED = fromString("Connected"); - - /** Static value Disconnected for NodeArcState. */ - public static final NodeArcState DISCONNECTED = fromString("Disconnected"); - - /** Static value Deleted for NodeArcState. */ - public static final NodeArcState DELETED = fromString("Deleted"); - - /** Static value Creating for NodeArcState. */ - public static final NodeArcState CREATING = fromString("Creating"); - - /** Static value Updating for NodeArcState. */ - public static final NodeArcState UPDATING = fromString("Updating"); - - /** Static value Deleting for NodeArcState. */ - public static final NodeArcState DELETING = fromString("Deleting"); - - /** Static value Moving for NodeArcState. */ - public static final NodeArcState MOVING = fromString("Moving"); - - /** - * Creates or finds a NodeArcState from its string representation. - * - * @param name a name to look for. - * @return the corresponding NodeArcState. - */ - @JsonCreator - public static NodeArcState fromString(String name) { - return fromString(name, NodeArcState.class); - } - - /** - * Gets known NodeArcState values. - * - * @return known NodeArcState values. - */ - public static Collection values() { - return values(NodeArcState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java deleted file mode 100644 index c3394d36855f4..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java +++ /dev/null @@ -1,68 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NodeExtensionState. */ -public final class NodeExtensionState extends ExpandableStringEnum { - /** Static value NotSpecified for NodeExtensionState. */ - public static final NodeExtensionState NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value Error for NodeExtensionState. */ - public static final NodeExtensionState ERROR = fromString("Error"); - - /** Static value Succeeded for NodeExtensionState. */ - public static final NodeExtensionState SUCCEEDED = fromString("Succeeded"); - - /** Static value Canceled for NodeExtensionState. */ - public static final NodeExtensionState CANCELED = fromString("Canceled"); - - /** Static value Failed for NodeExtensionState. */ - public static final NodeExtensionState FAILED = fromString("Failed"); - - /** Static value Connected for NodeExtensionState. */ - public static final NodeExtensionState CONNECTED = fromString("Connected"); - - /** Static value Disconnected for NodeExtensionState. */ - public static final NodeExtensionState DISCONNECTED = fromString("Disconnected"); - - /** Static value Deleted for NodeExtensionState. */ - public static final NodeExtensionState DELETED = fromString("Deleted"); - - /** Static value Creating for NodeExtensionState. */ - public static final NodeExtensionState CREATING = fromString("Creating"); - - /** Static value Updating for NodeExtensionState. */ - public static final NodeExtensionState UPDATING = fromString("Updating"); - - /** Static value Deleting for NodeExtensionState. */ - public static final NodeExtensionState DELETING = fromString("Deleting"); - - /** Static value Moving for NodeExtensionState. */ - public static final NodeExtensionState MOVING = fromString("Moving"); - - /** - * Creates or finds a NodeExtensionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding NodeExtensionState. - */ - @JsonCreator - public static NodeExtensionState fromString(String name) { - return fromString(name, NodeExtensionState.class); - } - - /** - * Gets known NodeExtensionState values. - * - * @return known NodeExtensionState values. - */ - public static Collection values() { - return values(NodeExtensionState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java new file mode 100644 index 0000000000000..8514fa16699ff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Operating system type that the gallery image uses [Windows, Linux]. */ +public enum OperatingSystemTypes { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OperatingSystemTypes instance. */ + private final String value; + + OperatingSystemTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperatingSystemTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed OperatingSystemTypes object, or null if unable to parse. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String value) { + if (value == null) { + return null; + } + OperatingSystemTypes[] items = OperatingSystemTypes.values(); + for (OperatingSystemTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java deleted file mode 100644 index 8a8c66e2aafe5..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java +++ /dev/null @@ -1,118 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent -public final class Operation { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) - private ActionType actionType; - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the Operation object itself. - */ - public Operation withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java deleted file mode 100644 index 75a95b413ce47..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java +++ /dev/null @@ -1,89 +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.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Localized display information for this particular operation. */ -@Immutable -public final class OperationDisplay { - /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java deleted file mode 100644 index 6f6f0475efc84..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java +++ /dev/null @@ -1,32 +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.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; -import java.util.List; - -/** An immutable client-side representation of OperationListResult. */ -public interface OperationListResult { - /** - * Gets the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner object. - * - * @return the inner object. - */ - OperationListResultInner innerModel(); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java deleted file mode 100644 index 570a7f0abbd4b..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java +++ /dev/null @@ -1,31 +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.azurestackhci.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - OperationListResult list(); - - /** - * List all available Microsoft.AzureStackHCI provider operations. - * - * @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 REST API operations supported by an Azure Resource Provider along with {@link Response}. - */ - Response listWithResponse(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java deleted file mode 100644 index 5eb928fb9ec93..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java +++ /dev/null @@ -1,41 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Origin. */ -public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ - public static final Origin USER = fromString("user"); - - /** Static value system for Origin. */ - public static final Origin SYSTEM = fromString("system"); - - /** Static value user,system for Origin. */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - @JsonCreator - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdate.java new file mode 100644 index 0000000000000..92be1b0c560d5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdate.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OsProfile - describes the update configuration of the operating system. */ +@Fluent +public final class OsProfileUpdate { + /* + * ComputerName - name of the computer + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * The linuxConfiguration property. + */ + @JsonProperty(value = "linuxConfiguration") + private OsProfileUpdateLinuxConfiguration linuxConfiguration; + + /* + * The windowsConfiguration property. + */ + @JsonProperty(value = "windowsConfiguration") + private OsProfileUpdateWindowsConfiguration windowsConfiguration; + + /** Creates an instance of OsProfileUpdate class. */ + public OsProfileUpdate() { + } + + /** + * Get the computerName property: ComputerName - name of the computer. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: ComputerName - name of the computer. + * + * @param computerName the computerName value to set. + * @return the OsProfileUpdate object itself. + */ + public OsProfileUpdate withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the linuxConfiguration property: The linuxConfiguration property. + * + * @return the linuxConfiguration value. + */ + public OsProfileUpdateLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: The linuxConfiguration property. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OsProfileUpdate object itself. + */ + public OsProfileUpdate withLinuxConfiguration(OsProfileUpdateLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the windowsConfiguration property: The windowsConfiguration property. + * + * @return the windowsConfiguration value. + */ + public OsProfileUpdateWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: The windowsConfiguration property. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the OsProfileUpdate object itself. + */ + public OsProfileUpdate withWindowsConfiguration(OsProfileUpdateWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateLinuxConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateLinuxConfiguration.java new file mode 100644 index 0000000000000..5f14bd85973bb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateLinuxConfiguration.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OsProfileUpdateLinuxConfiguration model. */ +@Fluent +public final class OsProfileUpdateLinuxConfiguration { + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine + * instance creation process. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + @JsonProperty(value = "provisionVMConfigAgent") + private Boolean provisionVMConfigAgent; + + /** Creates an instance of OsProfileUpdateLinuxConfiguration class. */ + public OsProfileUpdateLinuxConfiguration() { + } + + /** + * Get the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the OsProfileUpdateLinuxConfiguration object itself. + */ + public OsProfileUpdateLinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @return the provisionVMConfigAgent value. + */ + public Boolean provisionVMConfigAgent() { + return this.provisionVMConfigAgent; + } + + /** + * Set the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @param provisionVMConfigAgent the provisionVMConfigAgent value to set. + * @return the OsProfileUpdateLinuxConfiguration object itself. + */ + public OsProfileUpdateLinuxConfiguration withProvisionVMConfigAgent(Boolean provisionVMConfigAgent) { + this.provisionVMConfigAgent = provisionVMConfigAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateWindowsConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateWindowsConfiguration.java new file mode 100644 index 0000000000000..10167da39c0a0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateWindowsConfiguration.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OsProfileUpdateWindowsConfiguration model. */ +@Fluent +public final class OsProfileUpdateWindowsConfiguration { + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine + * instance creation process. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + @JsonProperty(value = "provisionVMConfigAgent") + private Boolean provisionVMConfigAgent; + + /** Creates an instance of OsProfileUpdateWindowsConfiguration class. */ + public OsProfileUpdateWindowsConfiguration() { + } + + /** + * Get the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the OsProfileUpdateWindowsConfiguration object itself. + */ + public OsProfileUpdateWindowsConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @return the provisionVMConfigAgent value. + */ + public Boolean provisionVMConfigAgent() { + return this.provisionVMConfigAgent; + } + + /** + * Set the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @param provisionVMConfigAgent the provisionVMConfigAgent value to set. + * @return the OsProfileUpdateWindowsConfiguration object itself. + */ + public OsProfileUpdateWindowsConfiguration withProvisionVMConfigAgent(Boolean provisionVMConfigAgent) { + this.provisionVMConfigAgent = provisionVMConfigAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java deleted file mode 100644 index ed82f484e14ff..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of PasswordCredential. */ -public interface PasswordCredential { - /** - * Gets the secretText property: The secretText property. - * - * @return the secretText value. - */ - String secretText(); - - /** - * Gets the keyId property: The keyId property. - * - * @return the keyId value. - */ - String keyId(); - - /** - * Gets the startDateTime property: The startDateTime property. - * - * @return the startDateTime value. - */ - OffsetDateTime startDateTime(); - - /** - * Gets the endDateTime property: The endDateTime property. - * - * @return the endDateTime value. - */ - OffsetDateTime endDateTime(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner object. - * - * @return the inner object. - */ - PasswordCredentialInner innerModel(); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java deleted file mode 100644 index 54a16e384b67d..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.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.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Status of Arc Extension for a particular node in HCI Cluster. */ -@Immutable -public final class PerNodeExtensionState { - /* - * Name of the node in HCI Cluster. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Fully qualified resource ID for the particular Arc Extension on this - * node. - */ - @JsonProperty(value = "extension", access = JsonProperty.Access.WRITE_ONLY) - private String extension; - - /* - * State of Arc Extension in this node. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private NodeExtensionState state; - - /** - * Get the name property: Name of the node in HCI Cluster. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the extension property: Fully qualified resource ID for the particular Arc Extension on this node. - * - * @return the extension value. - */ - public String extension() { - return this.extension; - } - - /** - * Get the state property: State of Arc Extension in this node. - * - * @return the state value. - */ - public NodeExtensionState state() { - return this.state; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java deleted file mode 100644 index 9dad6d8d94a08..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Status of Arc agent for a particular node in HCI Cluster. */ -@Immutable -public final class PerNodeState { - /* - * Name of the Node in HCI Cluster - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Fully qualified resource ID for the Arc agent of this node. - */ - @JsonProperty(value = "arcInstance", access = JsonProperty.Access.WRITE_ONLY) - private String arcInstance; - - /* - * State of Arc agent in this node. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private NodeArcState state; - - /** - * Get the name property: Name of the Node in HCI Cluster. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the arcInstance property: Fully qualified resource ID for the Arc agent of this node. - * - * @return the arcInstance value. - */ - public String arcInstance() { - return this.arcInstance; - } - - /** - * Get the state property: State of Arc agent in this node. - * - * @return the state value. - */ - public NodeArcState state() { - return this.state; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PowerStateEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PowerStateEnum.java new file mode 100644 index 0000000000000..7691d9454c9ef --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PowerStateEnum.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The power state of the virtual machine instance. */ +public final class PowerStateEnum extends ExpandableStringEnum { + /** Static value Deallocated for PowerStateEnum. */ + public static final PowerStateEnum DEALLOCATED = fromString("Deallocated"); + + /** Static value Deallocating for PowerStateEnum. */ + public static final PowerStateEnum DEALLOCATING = fromString("Deallocating"); + + /** Static value Running for PowerStateEnum. */ + public static final PowerStateEnum RUNNING = fromString("Running"); + + /** Static value Starting for PowerStateEnum. */ + public static final PowerStateEnum STARTING = fromString("Starting"); + + /** Static value Stopped for PowerStateEnum. */ + public static final PowerStateEnum STOPPED = fromString("Stopped"); + + /** Static value Stopping for PowerStateEnum. */ + public static final PowerStateEnum STOPPING = fromString("Stopping"); + + /** Static value Unknown for PowerStateEnum. */ + public static final PowerStateEnum UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of PowerStateEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PowerStateEnum() { + } + + /** + * Creates or finds a PowerStateEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding PowerStateEnum. + */ + @JsonCreator + public static PowerStateEnum fromString(String name) { + return fromString(name, PowerStateEnum.class); + } + + /** + * Gets known PowerStateEnum values. + * + * @return known PowerStateEnum values. + */ + public static Collection values() { + return values(PowerStateEnum.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningAction.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningAction.java new file mode 100644 index 0000000000000..9c8b56e4f67c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the different types of operations for guest agent. */ +public final class ProvisioningAction extends ExpandableStringEnum { + /** Static value install for ProvisioningAction. */ + public static final ProvisioningAction INSTALL = fromString("install"); + + /** Static value uninstall for ProvisioningAction. */ + public static final ProvisioningAction UNINSTALL = fromString("uninstall"); + + /** Static value repair for ProvisioningAction. */ + public static final ProvisioningAction REPAIR = fromString("repair"); + + /** + * Creates a new instance of ProvisioningAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningAction() { + } + + /** + * Creates or finds a ProvisioningAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningAction. + */ + @JsonCreator + public static ProvisioningAction fromString(String name) { + return fromString(name, ProvisioningAction.class); + } + + /** + * Gets known ProvisioningAction values. + * + * @return known ProvisioningAction values. + */ + public static Collection values() { + return values(ProvisioningAction.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java deleted file mode 100644 index 117f3584ed155..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java +++ /dev/null @@ -1,47 +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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningState. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** Static value Accepted for ProvisioningState. */ - public static final ProvisioningState ACCEPTED = fromString("Accepted"); - - /** Static value Provisioning for ProvisioningState. */ - public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - - /** - * 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java new file mode 100644 index 0000000000000..8216560bfdd9d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the gallery image. */ +public final class ProvisioningStateEnum extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum FAILED = fromString("Failed"); + + /** Static value InProgress for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum IN_PROGRESS = fromString("InProgress"); + + /** Static value Accepted for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum DELETING = fromString("Deleting"); + + /** Static value Canceled for ProvisioningStateEnum. */ + public static final ProvisioningStateEnum CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningStateEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningStateEnum() { + } + + /** + * Creates or finds a ProvisioningStateEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStateEnum. + */ + @JsonCreator + public static ProvisioningStateEnum fromString(String name) { + return fromString(name, ProvisioningStateEnum.class); + } + + /** + * Gets known ProvisioningStateEnum values. + * + * @return known ProvisioningStateEnum values. + */ + public static Collection values() { + return values(ProvisioningStateEnum.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java deleted file mode 100644 index 5cb214a9d881a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java +++ /dev/null @@ -1,47 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The RawCertificateData model. */ -@Fluent -public final class RawCertificateData { - /* - * The certificates property. - */ - @JsonProperty(value = "certificates") - private List certificates; - - /** - * Get the certificates property: The certificates property. - * - * @return the certificates value. - */ - public List certificates() { - return this.certificates; - } - - /** - * Set the certificates property: The certificates property. - * - * @param certificates the certificates value to set. - * @return the RawCertificateData object itself. - */ - public RawCertificateData withCertificates(List certificates) { - this.certificates = certificates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ResourceIdentityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..f8756dc42fa80 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ResourceIdentityType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The identity type. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityTypes.java new file mode 100644 index 0000000000000..5d8926382c65f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityTypes.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for + * SecurityType to function. + */ +public final class SecurityTypes extends ExpandableStringEnum { + /** Static value TrustedLaunch for SecurityTypes. */ + public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** Static value ConfidentialVM for SecurityTypes. */ + public static final SecurityTypes CONFIDENTIAL_VM = fromString("ConfidentialVM"); + + /** + * Creates a new instance of SecurityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityTypes() { + } + + /** + * Creates or finds a SecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityTypes. + */ + @JsonCreator + public static SecurityTypes fromString(String name) { + return fromString(name, SecurityTypes.class); + } + + /** + * Gets known SecurityTypes values. + * + * @return known SecurityTypes values. + */ + public static Collection values() { + return values(SecurityTypes.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshConfiguration.java new file mode 100644 index 0000000000000..7bbc1dbc3055d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshConfiguration.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** Creates an instance of SshConfiguration class. */ + public SshConfiguration() { + } + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the SshConfiguration object itself. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshPublicKey.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshPublicKey.java new file mode 100644 index 0000000000000..9f5d9a30483b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshPublicKey.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + */ +@Fluent +public final class SshPublicKey { + /* + * Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the + * specified key is appended to the file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /* + * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit + * and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** Creates an instance of SshPublicKey class. */ + public SshPublicKey() { + } + + /** + * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java index 91733d95bf457..28bf6efd61dfa 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -8,22 +8,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** The status of the operation performed on the gallery image [Succeeded, Failed, InProgress]. */ public final class Status extends ExpandableStringEnum { - /** Static value NotYetRegistered for Status. */ - public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); + /** Static value Succeeded for Status. */ + public static final Status SUCCEEDED = fromString("Succeeded"); - /** Static value ConnectedRecently for Status. */ - public static final Status CONNECTED_RECENTLY = fromString("ConnectedRecently"); + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); - /** Static value NotConnectedRecently for Status. */ - public static final Status NOT_CONNECTED_RECENTLY = fromString("NotConnectedRecently"); + /** Static value InProgress for Status. */ + public static final Status IN_PROGRESS = fromString("InProgress"); - /** Static value Disconnected for Status. */ - public static final Status DISCONNECTED = fromString("Disconnected"); - - /** Static value Error for Status. */ - public static final Status ERROR = fromString("Error"); + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } /** * Creates or finds a Status from its string representation. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java new file mode 100644 index 0000000000000..961c0cb87ee50 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The level code. */ +public final class StatusLevelTypes extends ExpandableStringEnum { + /** Static value Info for StatusLevelTypes. */ + public static final StatusLevelTypes INFO = fromString("Info"); + + /** Static value Warning for StatusLevelTypes. */ + public static final StatusLevelTypes WARNING = fromString("Warning"); + + /** Static value Error for StatusLevelTypes. */ + public static final StatusLevelTypes ERROR = fromString("Error"); + + /** + * Creates a new instance of StatusLevelTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusLevelTypes() { + } + + /** + * Creates or finds a StatusLevelTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusLevelTypes. + */ + @JsonCreator + public static StatusLevelTypes fromString(String name) { + return fromString(name, StatusLevelTypes.class); + } + + /** + * Gets known StatusLevelTypes values. + * + * @return known StatusLevelTypes values. + */ + public static Collection values() { + return values(StatusLevelTypes.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusTypes.java new file mode 100644 index 0000000000000..af8474403d214 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusTypes.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The installation status of the hybrid machine agent installation. */ +public final class StatusTypes extends ExpandableStringEnum { + /** Static value Succeeded for StatusTypes. */ + public static final StatusTypes SUCCEEDED = fromString("Succeeded"); + + /** Static value InProgress for StatusTypes. */ + public static final StatusTypes IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for StatusTypes. */ + public static final StatusTypes FAILED = fromString("Failed"); + + /** + * Creates a new instance of StatusTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusTypes() { + } + + /** + * Creates or finds a StatusTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusTypes. + */ + @JsonCreator + public static StatusTypes fromString(String name) { + return fromString(name, StatusTypes.class); + } + + /** + * Gets known StatusTypes values. + * + * @return known StatusTypes values. + */ + public static Collection values() { + return values(StatusTypes.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatus.java new file mode 100644 index 0000000000000..a8603a5725f33 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatus.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of storage containers. */ +@Fluent +public final class StorageContainerStatus { + /* + * StorageContainer provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Amount of space available on the disk in MB + */ + @JsonProperty(value = "availableSizeMB") + private Long availableSizeMB; + + /* + * Total size of the disk in MB + */ + @JsonProperty(value = "containerSizeMB") + private Long containerSizeMB; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private StorageContainerStatusProvisioningStatus provisioningStatus; + + /** Creates an instance of StorageContainerStatus class. */ + public StorageContainerStatus() { + } + + /** + * Get the errorCode property: StorageContainer provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: StorageContainer provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the StorageContainerStatus object itself. + */ + public StorageContainerStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the StorageContainerStatus object itself. + */ + public StorageContainerStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the availableSizeMB property: Amount of space available on the disk in MB. + * + * @return the availableSizeMB value. + */ + public Long availableSizeMB() { + return this.availableSizeMB; + } + + /** + * Set the availableSizeMB property: Amount of space available on the disk in MB. + * + * @param availableSizeMB the availableSizeMB value to set. + * @return the StorageContainerStatus object itself. + */ + public StorageContainerStatus withAvailableSizeMB(Long availableSizeMB) { + this.availableSizeMB = availableSizeMB; + return this; + } + + /** + * Get the containerSizeMB property: Total size of the disk in MB. + * + * @return the containerSizeMB value. + */ + public Long containerSizeMB() { + return this.containerSizeMB; + } + + /** + * Set the containerSizeMB property: Total size of the disk in MB. + * + * @param containerSizeMB the containerSizeMB value to set. + * @return the StorageContainerStatus object itself. + */ + public StorageContainerStatus withContainerSizeMB(Long containerSizeMB) { + this.containerSizeMB = containerSizeMB; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public StorageContainerStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the StorageContainerStatus object itself. + */ + public StorageContainerStatus withProvisioningStatus(StorageContainerStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatusProvisioningStatus.java new file mode 100644 index 0000000000000..895cf66c5d7e5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageContainerStatusProvisioningStatus model. */ +@Fluent +public final class StorageContainerStatusProvisioningStatus { + /* + * The ID of the operation performed on the storage container + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the storage container [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of StorageContainerStatusProvisioningStatus class. */ + public StorageContainerStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the storage container. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the storage container. + * + * @param operationId the operationId value to set. + * @return the StorageContainerStatusProvisioningStatus object itself. + */ + public StorageContainerStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the storage container [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the storage container [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the StorageContainerStatusProvisioningStatus object itself. + */ + public StorageContainerStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainers.java new file mode 100644 index 0000000000000..52560f11a3421 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainers.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import java.util.Map; + +/** An immutable client-side representation of StorageContainers. */ +public interface StorageContainers { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the path property: Path of the storage container on the disk. + * + * @return the path value. + */ + String path(); + + /** + * Gets the provisioningState property: Provisioning state of the storage container. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the status property: The observed state of storage containers. + * + * @return the status value. + */ + StorageContainerStatus status(); + + /** + * 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.azurestackhci.fluent.models.StorageContainersInner object. + * + * @return the inner object. + */ + StorageContainersInner innerModel(); + + /** The entirety of the StorageContainers definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The StorageContainers definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageContainers definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the StorageContainers 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 StorageContainers 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 StorageContainers 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.WithExtendedLocation, DefinitionStages.WithPath { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageContainers create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageContainers create(Context context); + } + + /** The stage of the StorageContainers 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 StorageContainers definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the StorageContainers definition allowing to specify path. */ + interface WithPath { + /** + * Specifies the path property: Path of the storage container on the disk. + * + * @param path Path of the storage container on the disk. + * @return the next definition stage. + */ + WithCreate withPath(String path); + } + } + + /** + * Begins update for the StorageContainers resource. + * + * @return the stage of resource update. + */ + StorageContainers.Update update(); + + /** The template for StorageContainers update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageContainers apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageContainers apply(Context context); + } + + /** The StorageContainers update stages. */ + interface UpdateStages { + /** The stage of the StorageContainers update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageContainers refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageContainers refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersListResult.java new file mode 100644 index 0000000000000..48abe2a4e5c6c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The StorageContainersListResult model. */ +@Fluent +public final class StorageContainersListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of StorageContainersListResult class. */ + public StorageContainersListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the StorageContainersListResult object itself. + */ + public StorageContainersListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the StorageContainersListResult object itself. + */ + public StorageContainersListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersOperations.java new file mode 100644 index 0000000000000..ae754fde86a59 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersOperations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 StorageContainersOperations. */ +public interface StorageContainersOperations { + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String storageContainerName, Context context); + + /** + * Gets a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storage container. + */ + StorageContainers getByResourceGroup(String resourceGroupName, String storageContainerName); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @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 storageContainerName); + + /** + * The operation to delete a storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageContainerName Name of the storage container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String storageContainerName, Context context); + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to + * get the next page of storage containers. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a storage container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a storage container along with {@link Response}. + */ + StorageContainers getById(String id); + + /** + * Gets a storage container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a storage container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a storage container. + * + * @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); + + /** + * The operation to delete a storage container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageContainers resource. + * + * @param name resource name. + * @return the first stage of the new StorageContainers definition. + */ + StorageContainers.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersUpdateRequest.java new file mode 100644 index 0000000000000..90a85e3dce0c1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The storage container resource patch definition. */ +@Fluent +public final class StorageContainersUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of StorageContainersUpdateRequest class. */ + public StorageContainersUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the StorageContainersUpdateRequest object itself. + */ + public StorageContainersUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java new file mode 100644 index 0000000000000..16dbf2a6ecace --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The StorageProfileUpdate model. */ +@Fluent +public final class StorageProfileUpdate { + /* + * adds data disks to the virtual machine instance for the update call + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** Creates an instance of StorageProfileUpdate class. */ + public StorageProfileUpdate() { + } + + /** + * Get the dataDisks property: adds data disks to the virtual machine instance for the update call. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: adds data disks to the virtual machine instance for the update call. + * + * @param dataDisks the dataDisks value to set. + * @return the StorageProfileUpdate object itself. + */ + public StorageProfileUpdate withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java new file mode 100644 index 0000000000000..19972d824357c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageProfileUpdateDataDisksItem model. */ +@Fluent +public final class StorageProfileUpdateDataDisksItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of StorageProfileUpdateDataDisksItem class. */ + public StorageProfileUpdateDataDisksItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the StorageProfileUpdateDataDisksItem object itself. + */ + public StorageProfileUpdateDataDisksItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java deleted file mode 100644 index 8fabb105a6622..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java +++ /dev/null @@ -1,49 +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.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UploadCertificateRequest model. */ -@Fluent -public final class UploadCertificateRequest { - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private RawCertificateData properties; - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public RawCertificateData properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the UploadCertificateRequest object itself. - */ - public UploadCertificateRequest withProperties(RawCertificateData properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatus.java new file mode 100644 index 0000000000000..c704c8114b5b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatus.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of virtual hard disks. */ +@Fluent +public final class VirtualHardDiskStatus { + /* + * VirtualHardDisk provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private VirtualHardDiskStatusProvisioningStatus provisioningStatus; + + /** Creates an instance of VirtualHardDiskStatus class. */ + public VirtualHardDiskStatus() { + } + + /** + * Get the errorCode property: VirtualHardDisk provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: VirtualHardDisk provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the VirtualHardDiskStatus object itself. + */ + public VirtualHardDiskStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the VirtualHardDiskStatus object itself. + */ + public VirtualHardDiskStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public VirtualHardDiskStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the VirtualHardDiskStatus object itself. + */ + public VirtualHardDiskStatus withProvisioningStatus(VirtualHardDiskStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatusProvisioningStatus.java new file mode 100644 index 0000000000000..f3290352a0f5c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualHardDiskStatusProvisioningStatus model. */ +@Fluent +public final class VirtualHardDiskStatusProvisioningStatus { + /* + * The ID of the operation performed on the virtual hard disk + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the virtual hard disk [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of VirtualHardDiskStatusProvisioningStatus class. */ + public VirtualHardDiskStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the virtual hard disk. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the virtual hard disk. + * + * @param operationId the operationId value to set. + * @return the VirtualHardDiskStatusProvisioningStatus object itself. + */ + public VirtualHardDiskStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the virtual hard disk [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the virtual hard disk [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the VirtualHardDiskStatusProvisioningStatus object itself. + */ + public VirtualHardDiskStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisks.java new file mode 100644 index 0000000000000..b9559b3540618 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisks.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import java.util.Map; + +/** An immutable client-side representation of VirtualHardDisks. */ +public interface VirtualHardDisks { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + Integer blockSizeBytes(); + + /** + * Gets the diskSizeGB property: Size of the disk in GB. + * + * @return the diskSizeGB value. + */ + Long diskSizeGB(); + + /** + * Gets the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + Boolean dynamic(); + + /** + * Gets the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + Integer logicalSectorBytes(); + + /** + * Gets the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + Integer physicalSectorBytes(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @return the diskFileFormat value. + */ + DiskFileFormat diskFileFormat(); + + /** + * Gets the provisioningState property: Provisioning state of the virtual hard disk. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @return the containerId value. + */ + String containerId(); + + /** + * Gets the status property: The observed state of virtual hard disks. + * + * @return the status value. + */ + VirtualHardDiskStatus status(); + + /** + * 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.azurestackhci.fluent.models.VirtualHardDisksInner object. + * + * @return the inner object. + */ + VirtualHardDisksInner innerModel(); + + /** The entirety of the VirtualHardDisks definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The VirtualHardDisks definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualHardDisks definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the VirtualHardDisks 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 VirtualHardDisks 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 VirtualHardDisks 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.WithExtendedLocation, + DefinitionStages.WithBlockSizeBytes, + DefinitionStages.WithDiskSizeGB, + DefinitionStages.WithDynamic, + DefinitionStages.WithLogicalSectorBytes, + DefinitionStages.WithPhysicalSectorBytes, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithDiskFileFormat, + DefinitionStages.WithContainerId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualHardDisks create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualHardDisks create(Context context); + } + + /** The stage of the VirtualHardDisks 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 VirtualHardDisks definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the VirtualHardDisks definition allowing to specify blockSizeBytes. */ + interface WithBlockSizeBytes { + /** + * Specifies the blockSizeBytes property: The blockSizeBytes property.. + * + * @param blockSizeBytes The blockSizeBytes property. + * @return the next definition stage. + */ + WithCreate withBlockSizeBytes(Integer blockSizeBytes); + } + + /** The stage of the VirtualHardDisks definition allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: Size of the disk in GB. + * + * @param diskSizeGB Size of the disk in GB. + * @return the next definition stage. + */ + WithCreate withDiskSizeGB(Long diskSizeGB); + } + + /** The stage of the VirtualHardDisks definition allowing to specify dynamic. */ + interface WithDynamic { + /** + * Specifies the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic Boolean for enabling dynamic sizing on the virtual hard disk. + * @return the next definition stage. + */ + WithCreate withDynamic(Boolean dynamic); + } + + /** The stage of the VirtualHardDisks definition allowing to specify logicalSectorBytes. */ + interface WithLogicalSectorBytes { + /** + * Specifies the logicalSectorBytes property: The logicalSectorBytes property.. + * + * @param logicalSectorBytes The logicalSectorBytes property. + * @return the next definition stage. + */ + WithCreate withLogicalSectorBytes(Integer logicalSectorBytes); + } + + /** The stage of the VirtualHardDisks definition allowing to specify physicalSectorBytes. */ + interface WithPhysicalSectorBytes { + /** + * Specifies the physicalSectorBytes property: The physicalSectorBytes property.. + * + * @param physicalSectorBytes The physicalSectorBytes property. + * @return the next definition stage. + */ + WithCreate withPhysicalSectorBytes(Integer physicalSectorBytes); + } + + /** The stage of the VirtualHardDisks definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2]. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + + /** The stage of the VirtualHardDisks definition allowing to specify diskFileFormat. */ + interface WithDiskFileFormat { + /** + * Specifies the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. + * + * @param diskFileFormat The format of the actual VHD file [vhd, vhdx]. + * @return the next definition stage. + */ + WithCreate withDiskFileFormat(DiskFileFormat diskFileFormat); + } + + /** The stage of the VirtualHardDisks definition allowing to specify containerId. */ + interface WithContainerId { + /** + * Specifies the containerId property: Storage ContainerID of the storage container to be used for VHD. + * + * @param containerId Storage ContainerID of the storage container to be used for VHD. + * @return the next definition stage. + */ + WithCreate withContainerId(String containerId); + } + } + + /** + * Begins update for the VirtualHardDisks resource. + * + * @return the stage of resource update. + */ + VirtualHardDisks.Update update(); + + /** The template for VirtualHardDisks update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualHardDisks apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualHardDisks apply(Context context); + } + + /** The VirtualHardDisks update stages. */ + interface UpdateStages { + /** The stage of the VirtualHardDisks update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualHardDisks refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualHardDisks refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksListResult.java new file mode 100644 index 0000000000000..ef85352a516bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualHardDisksListResult model. */ +@Fluent +public final class VirtualHardDisksListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VirtualHardDisksListResult class. */ + public VirtualHardDisksListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualHardDisksListResult object itself. + */ + public VirtualHardDisksListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualHardDisksListResult object itself. + */ + public VirtualHardDisksListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.java similarity index 53% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.java index 989e69c94dfca..431d46dc766ab 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.java @@ -8,179 +8,129 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Clusters. */ -public interface Clusters { +/** Resource collection API of VirtualHardDisksOperations. */ +public interface VirtualHardDisksOperations { /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all HCI clusters in a subscription. - * - * @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 list of clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * List all HCI clusters in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all HCI clusters in a resource group. + * Gets a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 list of clusters as paginated response with {@link PagedIterable}. + * @return a virtual hard disk along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHardDiskName, Context context); /** - * Get HCI cluster. + * Gets a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 hCI cluster. + * @return a virtual hard disk. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + VirtualHardDisks getByResourceGroup(String resourceGroupName, String virtualHardDiskName); /** - * Get HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. + * @param virtualHardDiskName Name of the virtual hard disk. * @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 hCI cluster along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + void deleteByResourceGroup(String resourceGroupName, String virtualHardDiskName); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 clusterName); - - /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualHardDiskName Name of the virtual hard disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String clusterName, Context context); + void delete(String resourceGroupName, String virtualHardDiskName, Context context); /** - * Upload certificate. + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. * @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 paginated response with {@link PagedIterable}. */ - void uploadCertificate( - String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Upload certificate. + * Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual hard disks. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param uploadCertificateRequest Upload certificate request. * @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 paginated response with {@link PagedIterable}. */ - void uploadCertificate( - String resourceGroupName, - String clusterName, - UploadCertificateRequest uploadCertificateRequest, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @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 cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName); + PagedIterable list(); /** - * Create cluster identity. + * Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 cluster Identity details. + * @return the paginated response with {@link PagedIterable}. */ - ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); + PagedIterable list(Context context); /** - * Get HCI cluster. + * Gets a virtual hard disk. * * @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 hCI cluster along with {@link Response}. + * @return a virtual hard disk along with {@link Response}. */ - Cluster getById(String id); + VirtualHardDisks getById(String id); /** - * Get HCI cluster. + * Gets a virtual hard disk. * * @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 hCI cluster along with {@link Response}. + * @return a virtual hard disk along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -190,7 +140,7 @@ void uploadCertificate( void deleteById(String id); /** - * Delete an HCI cluster. + * The operation to delete a virtual hard disk. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -201,10 +151,10 @@ void uploadCertificate( void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new Cluster resource. + * Begins definition for a new VirtualHardDisks resource. * * @param name resource name. - * @return the first stage of the new Cluster definition. + * @return the first stage of the new VirtualHardDisks definition. */ - Cluster.DefinitionStages.Blank define(String name); + VirtualHardDisks.DefinitionStages.Blank define(String name); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksUpdateRequest.java new file mode 100644 index 0000000000000..f82a434c0b2b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtual hard disk resource patch definition. */ +@Fluent +public final class VirtualHardDisksUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of VirtualHardDisksUpdateRequest class. */ + public VirtualHardDisksUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualHardDisksUpdateRequest object itself. + */ + public VirtualHardDisksUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstance.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstance.java new file mode 100644 index 0000000000000..eba0513a8ac18 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstance.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; + +/** An immutable client-side representation of VirtualMachineInstance. */ +public interface VirtualMachineInstance { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @return the hardwareProfile value. + */ + VirtualMachineInstancePropertiesHardwareProfile hardwareProfile(); + + /** + * Gets the networkProfile property: NetworkProfile - describes the network configuration the virtual machine + * instance. + * + * @return the networkProfile value. + */ + VirtualMachineInstancePropertiesNetworkProfile networkProfile(); + + /** + * Gets the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + VirtualMachineInstancePropertiesOsProfile osProfile(); + + /** + * Gets the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine + * instance. + * + * @return the securityProfile value. + */ + VirtualMachineInstancePropertiesSecurityProfile securityProfile(); + + /** + * Gets the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine instance. + * + * @return the storageProfile value. + */ + VirtualMachineInstancePropertiesStorageProfile storageProfile(); + + /** + * Gets the provisioningState property: Provisioning state of the virtual machine instance. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + VirtualMachineInstanceView instanceView(); + + /** + * Gets the status property: The observed state of virtual machine instances. + * + * @return the status value. + */ + VirtualMachineInstanceStatus status(); + + /** + * Gets the guestAgentInstallStatus property: Guest agent install status. + * + * @return the guestAgentInstallStatus value. + */ + GuestAgentInstallStatus guestAgentInstallStatus(); + + /** + * Gets the vmId property: Unique identifier for the vm resource. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. + * + * @return the resourceUid value. + */ + String resourceUid(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner object. + * + * @return the inner object. + */ + VirtualMachineInstanceInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceListResult.java new file mode 100644 index 0000000000000..b559c33870097 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualMachineInstanceListResult model. */ +@Fluent +public final class VirtualMachineInstanceListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VirtualMachineInstanceListResult class. */ + public VirtualMachineInstanceListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualMachineInstanceListResult object itself. + */ + public VirtualMachineInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineInstanceListResult object itself. + */ + public VirtualMachineInstanceListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfile.java new file mode 100644 index 0000000000000..3099705292166 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfile.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesHardwareProfile { + /* + * The vmSize property. + */ + @JsonProperty(value = "vmSize") + private VmSizeEnum vmSize; + + /* + * number of processors for the virtual machine instance + */ + @JsonProperty(value = "processors") + private Integer processors; + + /* + * RAM in MB for the virtual machine instance + */ + @JsonProperty(value = "memoryMB") + private Long memoryMB; + + /* + * The dynamicMemoryConfig property. + */ + @JsonProperty(value = "dynamicMemoryConfig") + private VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig; + + /** Creates an instance of VirtualMachineInstancePropertiesHardwareProfile class. */ + public VirtualMachineInstancePropertiesHardwareProfile() { + } + + /** + * Get the vmSize property: The vmSize property. + * + * @return the vmSize value. + */ + public VmSizeEnum vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The vmSize property. + * + * @param vmSize the vmSize value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfile withVmSize(VmSizeEnum vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the processors property: number of processors for the virtual machine instance. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: number of processors for the virtual machine instance. + * + * @param processors the processors value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfile withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Get the memoryMB property: RAM in MB for the virtual machine instance. + * + * @return the memoryMB value. + */ + public Long memoryMB() { + return this.memoryMB; + } + + /** + * Set the memoryMB property: RAM in MB for the virtual machine instance. + * + * @param memoryMB the memoryMB value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfile withMemoryMB(Long memoryMB) { + this.memoryMB = memoryMB; + return this; + } + + /** + * Get the dynamicMemoryConfig property: The dynamicMemoryConfig property. + * + * @return the dynamicMemoryConfig value. + */ + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig() { + return this.dynamicMemoryConfig; + } + + /** + * Set the dynamicMemoryConfig property: The dynamicMemoryConfig property. + * + * @param dynamicMemoryConfig the dynamicMemoryConfig value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfile withDynamicMemoryConfig( + VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig) { + this.dynamicMemoryConfig = dynamicMemoryConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dynamicMemoryConfig() != null) { + dynamicMemoryConfig().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.java new file mode 100644 index 0000000000000..2da79987e8aff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig model. */ +@Fluent +public final class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { + /* + * The maximumMemoryMB property. + */ + @JsonProperty(value = "maximumMemoryMB") + private Long maximumMemoryMB; + + /* + * The minimumMemoryMB property. + */ + @JsonProperty(value = "minimumMemoryMB") + private Long minimumMemoryMB; + + /* + * Defines the amount of extra memory that should be reserved for a virtual machine instance at runtime, as a + * percentage of the total memory that the virtual machine instance is thought to need. This only applies to + * virtual systems with dynamic memory enabled. This property can be in the range of 5 to 2000. + */ + @JsonProperty(value = "targetMemoryBuffer") + private Integer targetMemoryBuffer; + + /** Creates an instance of VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig class. */ + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig() { + } + + /** + * Get the maximumMemoryMB property: The maximumMemoryMB property. + * + * @return the maximumMemoryMB value. + */ + public Long maximumMemoryMB() { + return this.maximumMemoryMB; + } + + /** + * Set the maximumMemoryMB property: The maximumMemoryMB property. + * + * @param maximumMemoryMB the maximumMemoryMB value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig withMaximumMemoryMB( + Long maximumMemoryMB) { + this.maximumMemoryMB = maximumMemoryMB; + return this; + } + + /** + * Get the minimumMemoryMB property: The minimumMemoryMB property. + * + * @return the minimumMemoryMB value. + */ + public Long minimumMemoryMB() { + return this.minimumMemoryMB; + } + + /** + * Set the minimumMemoryMB property: The minimumMemoryMB property. + * + * @param minimumMemoryMB the minimumMemoryMB value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig withMinimumMemoryMB( + Long minimumMemoryMB) { + this.minimumMemoryMB = minimumMemoryMB; + return this; + } + + /** + * Get the targetMemoryBuffer property: Defines the amount of extra memory that should be reserved for a virtual + * machine instance at runtime, as a percentage of the total memory that the virtual machine instance is thought to + * need. This only applies to virtual systems with dynamic memory enabled. This property can be in the range of 5 to + * 2000. + * + * @return the targetMemoryBuffer value. + */ + public Integer targetMemoryBuffer() { + return this.targetMemoryBuffer; + } + + /** + * Set the targetMemoryBuffer property: Defines the amount of extra memory that should be reserved for a virtual + * machine instance at runtime, as a percentage of the total memory that the virtual machine instance is thought to + * need. This only applies to virtual systems with dynamic memory enabled. This property can be in the range of 5 to + * 2000. + * + * @param targetMemoryBuffer the targetMemoryBuffer value to set. + * @return the VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig withTargetMemoryBuffer( + Integer targetMemoryBuffer) { + this.targetMemoryBuffer = targetMemoryBuffer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfile.java new file mode 100644 index 0000000000000..85189f9c5391b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfile.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkProfile - describes the network configuration the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesNetworkProfile { + /* + * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** Creates an instance of VirtualMachineInstancePropertiesNetworkProfile class. */ + public VirtualMachineInstancePropertiesNetworkProfile() { + } + + /** + * Get the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine instance. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine instance. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the VirtualMachineInstancePropertiesNetworkProfile object itself. + */ + public VirtualMachineInstancePropertiesNetworkProfile withNetworkInterfaces( + List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.java new file mode 100644 index 0000000000000..f4699a166e1f7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem model. */ +@Fluent +public final class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem { + /* + * ID - Resource Id of the network interface + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem class. */ + public VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() { + } + + /** + * Get the id property: ID - Resource Id of the network interface. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - Resource Id of the network interface. + * + * @param id the id value to set. + * @return the VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem object itself. + */ + public VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfile.java new file mode 100644 index 0000000000000..bf1a7840475db --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfile.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OsProfile - describes the configuration of the operating system and sets login data. */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfile { + /* + * AdminPassword - admin password + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * AdminUsername - admin username + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * ComputerName - name of the compute + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * LinuxConfiguration - linux specific configuration values for the virtual machine instance + */ + @JsonProperty(value = "linuxConfiguration") + private VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration; + + /* + * Windows Configuration for the virtual machine instance + */ + @JsonProperty(value = "windowsConfiguration") + private VirtualMachineInstancePropertiesOsProfileWindowsConfiguration windowsConfiguration; + + /** Creates an instance of VirtualMachineInstancePropertiesOsProfile class. */ + public VirtualMachineInstancePropertiesOsProfile() { + } + + /** + * Get the adminPassword property: AdminPassword - admin password. + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: AdminPassword - admin password. + * + * @param adminPassword the adminPassword value to set. + * @return the VirtualMachineInstancePropertiesOsProfile object itself. + */ + public VirtualMachineInstancePropertiesOsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the adminUsername property: AdminUsername - admin username. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: AdminUsername - admin username. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineInstancePropertiesOsProfile object itself. + */ + public VirtualMachineInstancePropertiesOsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the computerName property: ComputerName - name of the compute. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: ComputerName - name of the compute. + * + * @param computerName the computerName value to set. + * @return the VirtualMachineInstancePropertiesOsProfile object itself. + */ + public VirtualMachineInstancePropertiesOsProfile withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the linuxConfiguration property: LinuxConfiguration - linux specific configuration values for the virtual + * machine instance. + * + * @return the linuxConfiguration value. + */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: LinuxConfiguration - linux specific configuration values for the virtual + * machine instance. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualMachineInstancePropertiesOsProfile object itself. + */ + public VirtualMachineInstancePropertiesOsProfile withLinuxConfiguration( + VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the windowsConfiguration property: Windows Configuration for the virtual machine instance. + * + * @return the windowsConfiguration value. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Windows Configuration for the virtual machine instance. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualMachineInstancePropertiesOsProfile object itself. + */ + public VirtualMachineInstancePropertiesOsProfile withWindowsConfiguration( + VirtualMachineInstancePropertiesOsProfileWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileLinuxConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileLinuxConfiguration.java new file mode 100644 index 0000000000000..ec12bb03ccb71 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileLinuxConfiguration.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LinuxConfiguration - linux specific configuration values for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfileLinuxConfiguration { + /* + * DisablePasswordAuthentication - whether password authentication should be disabled + */ + @JsonProperty(value = "disablePasswordAuthentication") + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine + * instance creation process. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + @JsonProperty(value = "provisionVMConfigAgent") + private Boolean provisionVMConfigAgent; + + /** Creates an instance of VirtualMachineInstancePropertiesOsProfileLinuxConfiguration class. */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration() { + } + + /** + * Get the disablePasswordAuthentication property: DisablePasswordAuthentication - whether password authentication + * should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: DisablePasswordAuthentication - whether password authentication + * should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the VirtualMachineInstancePropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withDisablePasswordAuthentication( + Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * Get the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @param ssh the ssh value to set. + * @return the VirtualMachineInstancePropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the VirtualMachineInstancePropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @return the provisionVMConfigAgent value. + */ + public Boolean provisionVMConfigAgent() { + return this.provisionVMConfigAgent; + } + + /** + * Set the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @param provisionVMConfigAgent the provisionVMConfigAgent value to set. + * @return the VirtualMachineInstancePropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withProvisionVMConfigAgent( + Boolean provisionVMConfigAgent) { + this.provisionVMConfigAgent = provisionVMConfigAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileWindowsConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileWindowsConfiguration.java new file mode 100644 index 0000000000000..f57a8d5b46480 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileWindowsConfiguration.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Windows Configuration for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfileWindowsConfiguration { + /* + * Whether to EnableAutomaticUpdates on the machine + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /* + * Specifies the ssh key configuration for Windows OS. + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /* + * TimeZone for the virtual machine instance + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine + * instance creation process. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + @JsonProperty(value = "provisionVMConfigAgent") + private Boolean provisionVMConfigAgent; + + /** Creates an instance of VirtualMachineInstancePropertiesOsProfileWindowsConfiguration class. */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration() { + } + + /** + * Get the enableAutomaticUpdates property: Whether to EnableAutomaticUpdates on the machine. + * + * @return the enableAutomaticUpdates value. + */ + public Boolean enableAutomaticUpdates() { + return this.enableAutomaticUpdates; + } + + /** + * Set the enableAutomaticUpdates property: Whether to EnableAutomaticUpdates on the machine. + * + * @param enableAutomaticUpdates the enableAutomaticUpdates value to set. + * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withEnableAutomaticUpdates( + Boolean enableAutomaticUpdates) { + this.enableAutomaticUpdates = enableAutomaticUpdates; + return this; + } + + /** + * Get the ssh property: Specifies the ssh key configuration for Windows OS. + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for Windows OS. + * + * @param ssh the ssh value to set. + * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the timeZone property: TimeZone for the virtual machine instance. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone for the virtual machine instance. + * + * @param timeZone the timeZone value to set. + * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Used to indicate whether Arc for Servers agent onboarding should be triggered + * during the virtual machine instance creation process. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withProvisionVMAgent( + Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @return the provisionVMConfigAgent value. + */ + public Boolean provisionVMConfigAgent() { + return this.provisionVMConfigAgent; + } + + /** + * Set the provisionVMConfigAgent property: Used to indicate whether the VM Config Agent should be installed during + * the virtual machine creation process. + * + * @param provisionVMConfigAgent the provisionVMConfigAgent value to set. + * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withProvisionVMConfigAgent( + Boolean provisionVMConfigAgent) { + this.provisionVMConfigAgent = provisionVMConfigAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfile.java new file mode 100644 index 0000000000000..6901104c8153d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfile.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SecurityProfile - Specifies the security settings for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesSecurityProfile { + /* + * The enableTPM property. + */ + @JsonProperty(value = "enableTPM") + private Boolean enableTpm; + + /* + * The uefiSettings property. + */ + @JsonProperty(value = "uefiSettings") + private VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings; + + /* + * Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for + * SecurityType to function. + */ + @JsonProperty(value = "securityType") + private SecurityTypes securityType; + + /** Creates an instance of VirtualMachineInstancePropertiesSecurityProfile class. */ + public VirtualMachineInstancePropertiesSecurityProfile() { + } + + /** + * Get the enableTpm property: The enableTPM property. + * + * @return the enableTpm value. + */ + public Boolean enableTpm() { + return this.enableTpm; + } + + /** + * Set the enableTpm property: The enableTPM property. + * + * @param enableTpm the enableTpm value to set. + * @return the VirtualMachineInstancePropertiesSecurityProfile object itself. + */ + public VirtualMachineInstancePropertiesSecurityProfile withEnableTpm(Boolean enableTpm) { + this.enableTpm = enableTpm; + return this; + } + + /** + * Get the uefiSettings property: The uefiSettings property. + * + * @return the uefiSettings value. + */ + public VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings() { + return this.uefiSettings; + } + + /** + * Set the uefiSettings property: The uefiSettings property. + * + * @param uefiSettings the uefiSettings value to set. + * @return the VirtualMachineInstancePropertiesSecurityProfile object itself. + */ + public VirtualMachineInstancePropertiesSecurityProfile withUefiSettings( + VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings) { + this.uefiSettings = uefiSettings; + return this; + } + + /** + * Get the securityType property: Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled + * must be set to true for SecurityType to function. + * + * @return the securityType value. + */ + public SecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled + * must be set to true for SecurityType to function. + * + * @param securityType the securityType value to set. + * @return the VirtualMachineInstancePropertiesSecurityProfile object itself. + */ + public VirtualMachineInstancePropertiesSecurityProfile withSecurityType(SecurityTypes securityType) { + this.securityType = securityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uefiSettings() != null) { + uefiSettings().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfileUefiSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfileUefiSettings.java new file mode 100644 index 0000000000000..5416dd9031918 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfileUefiSettings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineInstancePropertiesSecurityProfileUefiSettings model. */ +@Fluent +public final class VirtualMachineInstancePropertiesSecurityProfileUefiSettings { + /* + * Specifies whether secure boot should be enabled on the virtual machine instance. + */ + @JsonProperty(value = "secureBootEnabled") + private Boolean secureBootEnabled; + + /** Creates an instance of VirtualMachineInstancePropertiesSecurityProfileUefiSettings class. */ + public VirtualMachineInstancePropertiesSecurityProfileUefiSettings() { + } + + /** + * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine + * instance. + * + * @return the secureBootEnabled value. + */ + public Boolean secureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine + * instance. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the VirtualMachineInstancePropertiesSecurityProfileUefiSettings object itself. + */ + public VirtualMachineInstancePropertiesSecurityProfileUefiSettings withSecureBootEnabled( + Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfile.java new file mode 100644 index 0000000000000..8a2ff43897df0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfile.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** StorageProfile - contains information about the disks and storage information for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfile { + /* + * adds data disks to the virtual machine instance + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * Which Image to use for the virtual machine instance + */ + @JsonProperty(value = "imageReference") + private VirtualMachineInstancePropertiesStorageProfileImageReference imageReference; + + /* + * VHD to attach as OS disk + */ + @JsonProperty(value = "osDisk") + private VirtualMachineInstancePropertiesStorageProfileOsDisk osDisk; + + /* + * Id of the storage container that hosts the VM configuration file + */ + @JsonProperty(value = "vmConfigStoragePathId") + private String vmConfigStoragePathId; + + /** Creates an instance of VirtualMachineInstancePropertiesStorageProfile class. */ + public VirtualMachineInstancePropertiesStorageProfile() { + } + + /** + * Get the dataDisks property: adds data disks to the virtual machine instance. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: adds data disks to the virtual machine instance. + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualMachineInstancePropertiesStorageProfile object itself. + */ + public VirtualMachineInstancePropertiesStorageProfile withDataDisks( + List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the imageReference property: Which Image to use for the virtual machine instance. + * + * @return the imageReference value. + */ + public VirtualMachineInstancePropertiesStorageProfileImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Which Image to use for the virtual machine instance. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineInstancePropertiesStorageProfile object itself. + */ + public VirtualMachineInstancePropertiesStorageProfile withImageReference( + VirtualMachineInstancePropertiesStorageProfileImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: VHD to attach as OS disk. + * + * @return the osDisk value. + */ + public VirtualMachineInstancePropertiesStorageProfileOsDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: VHD to attach as OS disk. + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineInstancePropertiesStorageProfile object itself. + */ + public VirtualMachineInstancePropertiesStorageProfile withOsDisk( + VirtualMachineInstancePropertiesStorageProfileOsDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the vmConfigStoragePathId property: Id of the storage container that hosts the VM configuration file. + * + * @return the vmConfigStoragePathId value. + */ + public String vmConfigStoragePathId() { + return this.vmConfigStoragePathId; + } + + /** + * Set the vmConfigStoragePathId property: Id of the storage container that hosts the VM configuration file. + * + * @param vmConfigStoragePathId the vmConfigStoragePathId value to set. + * @return the VirtualMachineInstancePropertiesStorageProfile object itself. + */ + public VirtualMachineInstancePropertiesStorageProfile withVmConfigStoragePathId(String vmConfigStoragePathId) { + this.vmConfigStoragePathId = vmConfigStoragePathId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileDataDisksItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileDataDisksItem.java new file mode 100644 index 0000000000000..f51f94fb44f57 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileDataDisksItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineInstancePropertiesStorageProfileDataDisksItem model. */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileDataDisksItem { + /* + * Resource ID of the data disk + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileDataDisksItem class. */ + public VirtualMachineInstancePropertiesStorageProfileDataDisksItem() { + } + + /** + * Get the id property: Resource ID of the data disk. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of the data disk. + * + * @param id the id value to set. + * @return the VirtualMachineInstancePropertiesStorageProfileDataDisksItem object itself. + */ + public VirtualMachineInstancePropertiesStorageProfileDataDisksItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileImageReference.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileImageReference.java new file mode 100644 index 0000000000000..f9a099ce28a4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileImageReference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Which Image to use for the virtual machine instance. */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileImageReference { + /* + * Resource ID of the image + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileImageReference class. */ + public VirtualMachineInstancePropertiesStorageProfileImageReference() { + } + + /** + * Get the id property: Resource ID of the image. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of the image. + * + * @param id the id value to set. + * @return the VirtualMachineInstancePropertiesStorageProfileImageReference object itself. + */ + public VirtualMachineInstancePropertiesStorageProfileImageReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileOsDisk.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileOsDisk.java new file mode 100644 index 0000000000000..9e7571961f624 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileOsDisk.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VHD to attach as OS disk. */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileOsDisk { + /* + * Resource ID of the OS disk + */ + @JsonProperty(value = "id") + private String id; + + /* + * This property allows you to specify the type of the OS that is included in the disk if creating a VM from + * user-image or a specialized VHD. Possible values are: **Windows,** **Linux.** + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileOsDisk class. */ + public VirtualMachineInstancePropertiesStorageProfileOsDisk() { + } + + /** + * Get the id property: Resource ID of the OS disk. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of the OS disk. + * + * @param id the id value to set. + * @return the VirtualMachineInstancePropertiesStorageProfileOsDisk object itself. + */ + public VirtualMachineInstancePropertiesStorageProfileOsDisk withId(String id) { + this.id = id; + return this; + } + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**. + * + * @param osType the osType value to set. + * @return the VirtualMachineInstancePropertiesStorageProfileOsDisk object itself. + */ + public VirtualMachineInstancePropertiesStorageProfileOsDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatus.java new file mode 100644 index 0000000000000..c3ba6d850df99 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatus.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of virtual machine instances. */ +@Fluent +public final class VirtualMachineInstanceStatus { + /* + * VirtualMachine provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The power state of the virtual machine instance + */ + @JsonProperty(value = "powerState") + private PowerStateEnum powerState; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private VirtualMachineInstanceStatusProvisioningStatus provisioningStatus; + + /** Creates an instance of VirtualMachineInstanceStatus class. */ + public VirtualMachineInstanceStatus() { + } + + /** + * Get the errorCode property: VirtualMachine provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: VirtualMachine provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the VirtualMachineInstanceStatus object itself. + */ + public VirtualMachineInstanceStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the VirtualMachineInstanceStatus object itself. + */ + public VirtualMachineInstanceStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the powerState property: The power state of the virtual machine instance. + * + * @return the powerState value. + */ + public PowerStateEnum powerState() { + return this.powerState; + } + + /** + * Set the powerState property: The power state of the virtual machine instance. + * + * @param powerState the powerState value to set. + * @return the VirtualMachineInstanceStatus object itself. + */ + public VirtualMachineInstanceStatus withPowerState(PowerStateEnum powerState) { + this.powerState = powerState; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public VirtualMachineInstanceStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the VirtualMachineInstanceStatus object itself. + */ + public VirtualMachineInstanceStatus withProvisioningStatus( + VirtualMachineInstanceStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatusProvisioningStatus.java new file mode 100644 index 0000000000000..ed458095d1c74 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineInstanceStatusProvisioningStatus model. */ +@Fluent +public final class VirtualMachineInstanceStatusProvisioningStatus { + /* + * The ID of the operation performed on the virtual machine instance + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the virtual machine instance [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of VirtualMachineInstanceStatusProvisioningStatus class. */ + public VirtualMachineInstanceStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the virtual machine instance. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the virtual machine instance. + * + * @param operationId the operationId value to set. + * @return the VirtualMachineInstanceStatusProvisioningStatus object itself. + */ + public VirtualMachineInstanceStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the virtual machine instance [Succeeded, + * Failed, InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the virtual machine instance [Succeeded, + * Failed, InProgress]. + * + * @param status the status value to set. + * @return the VirtualMachineInstanceStatusProvisioningStatus object itself. + */ + public VirtualMachineInstanceStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateProperties.java new file mode 100644 index 0000000000000..bcd3277ff094f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the resource properties for the update. */ +@Fluent +public final class VirtualMachineInstanceUpdateProperties { + /* + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfileUpdate hardwareProfile; + + /* + * The storageProfile property. + */ + @JsonProperty(value = "storageProfile") + private StorageProfileUpdate storageProfile; + + /* + * NetworkProfile - describes the network update configuration the virtual machine instance + */ + @JsonProperty(value = "networkProfile") + private NetworkProfileUpdate networkProfile; + + /* + * OsProfile - describes the update configuration of the operating system + */ + @JsonProperty(value = "osProfile") + private OsProfileUpdate osProfile; + + /** Creates an instance of VirtualMachineInstanceUpdateProperties class. */ + public VirtualMachineInstanceUpdateProperties() { + } + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @return the hardwareProfile value. + */ + public HardwareProfileUpdate hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine + * instance. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withHardwareProfile(HardwareProfileUpdate hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: The storageProfile property. + * + * @return the storageProfile value. + */ + public StorageProfileUpdate storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: The storageProfile property. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network update configuration the virtual machine + * instance. + * + * @return the networkProfile value. + */ + public NetworkProfileUpdate networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network update configuration the virtual machine + * instance. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the osProfile property: OsProfile - describes the update configuration of the operating system. + * + * @return the osProfile value. + */ + public OsProfileUpdate osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OsProfile - describes the update configuration of the operating system. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withOsProfile(OsProfileUpdate osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateRequest.java new file mode 100644 index 0000000000000..5070e3dfca448 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual machine instance resource patch definition. */ +@Fluent +public final class VirtualMachineInstanceUpdateRequest { + /* + * Defines the resource properties for the update. + */ + @JsonProperty(value = "properties") + private VirtualMachineInstanceUpdateProperties properties; + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** Creates an instance of VirtualMachineInstanceUpdateRequest class. */ + public VirtualMachineInstanceUpdateRequest() { + } + + /** + * Get the properties property: Defines the resource properties for the update. + * + * @return the properties value. + */ + public VirtualMachineInstanceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Defines the resource properties for the update. + * + * @param properties the properties value to set. + * @return the VirtualMachineInstanceUpdateRequest object itself. + */ + public VirtualMachineInstanceUpdateRequest withProperties(VirtualMachineInstanceUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the VirtualMachineInstanceUpdateRequest object itself. + */ + public VirtualMachineInstanceUpdateRequest withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceView.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceView.java new file mode 100644 index 0000000000000..c3d384e600a72 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceView.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a virtual machine. */ +@Fluent +public final class VirtualMachineInstanceView { + /* + * The VM Config Agent running on the virtual machine. + */ + @JsonProperty(value = "vmAgent") + private VirtualMachineVMConfigAgentInstanceView vmAgent; + + /** Creates an instance of VirtualMachineInstanceView class. */ + public VirtualMachineInstanceView() { + } + + /** + * Get the vmAgent property: The VM Config Agent running on the virtual machine. + * + * @return the vmAgent value. + */ + public VirtualMachineVMConfigAgentInstanceView vmAgent() { + return this.vmAgent; + } + + /** + * Set the vmAgent property: The VM Config Agent running on the virtual machine. + * + * @param vmAgent the vmAgent value to set. + * @return the VirtualMachineInstanceView object itself. + */ + public VirtualMachineInstanceView withVmAgent(VirtualMachineVMConfigAgentInstanceView vmAgent) { + this.vmAgent = vmAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmAgent() != null) { + vmAgent().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstances.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstances.java new file mode 100644 index 0000000000000..c0ace49963d4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstances.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; + +/** Resource collection API of VirtualMachineInstances. */ +public interface VirtualMachineInstances { + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance. + */ + VirtualMachineInstance get(String resourceUri); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource definition. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance createOrUpdate( + String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param virtualMachineInstance The virtual machine instance resource patch definition. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance update( + String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance start(String resourceUri); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance start(String resourceUri, Context context); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance stop(String resourceUri); + + /** + * The operation to stop a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance stop(String resourceUri, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance restart(String resourceUri); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 virtual machine instance resource definition. + */ + VirtualMachineInstance restart(String resourceUri, Context context); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineVMConfigAgentInstanceView.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineVMConfigAgentInstanceView.java new file mode 100644 index 0000000000000..41649956b08f1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineVMConfigAgentInstanceView.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the VM Config Agent running on the virtual machine. */ +@Fluent +public final class VirtualMachineVMConfigAgentInstanceView { + /* + * The VM Config Agent full version. + */ + @JsonProperty(value = "vmVMConfigAgentVersion") + private String vmConfigAgentVersion; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** Creates an instance of VirtualMachineVMConfigAgentInstanceView class. */ + public VirtualMachineVMConfigAgentInstanceView() { + } + + /** + * Get the vmConfigAgentVersion property: The VM Config Agent full version. + * + * @return the vmConfigAgentVersion value. + */ + public String vmConfigAgentVersion() { + return this.vmConfigAgentVersion; + } + + /** + * Set the vmConfigAgentVersion property: The VM Config Agent full version. + * + * @param vmConfigAgentVersion the vmConfigAgentVersion value to set. + * @return the VirtualMachineVMConfigAgentInstanceView object itself. + */ + public VirtualMachineVMConfigAgentInstanceView withVmConfigAgentVersion(String vmConfigAgentVersion) { + this.vmConfigAgentVersion = vmConfigAgentVersion; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineVMConfigAgentInstanceView object itself. + */ + public VirtualMachineVMConfigAgentInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesDhcpOptions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesDhcpOptions.java new file mode 100644 index 0000000000000..a5534573a7d27 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesDhcpOptions.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option + * for a subnet overrides VNET DHCP options. + */ +@Fluent +public final class VirtualNetworkPropertiesDhcpOptions { + /* + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** Creates an instance of VirtualNetworkPropertiesDhcpOptions class. */ + public VirtualNetworkPropertiesDhcpOptions() { + } + + /** + * Get the dnsServers property: The list of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: The list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualNetworkPropertiesDhcpOptions object itself. + */ + public VirtualNetworkPropertiesDhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItem.java new file mode 100644 index 0000000000000..1c6ca1092b8a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItem.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworkPropertiesSubnetsItemAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet subnet in a virtual network resource. */ +@Fluent +public final class VirtualNetworkPropertiesSubnetsItem { + /* + * Name - The name of the resource that is unique within a resource group. This name can be used to access the + * resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * SubnetProperties - Properties of the subnet. + */ + @JsonProperty(value = "properties") + private VirtualNetworkPropertiesSubnetsItemAutoGenerated innerProperties; + + /** Creates an instance of VirtualNetworkPropertiesSubnetsItem class. */ + public VirtualNetworkPropertiesSubnetsItem() { + } + + /** + * Get the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @param name the name value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: SubnetProperties - Properties of the subnet. + * + * @return the innerProperties value. + */ + private VirtualNetworkPropertiesSubnetsItemAutoGenerated innerProperties() { + return this.innerProperties; + } + + /** + * Get the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Set the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefixes(); + } + + /** + * Set the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withAddressPrefixes(List addressPrefixes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withAddressPrefixes(addressPrefixes); + return this; + } + + /** + * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @return the ipAllocationMethod value. + */ + public IpAllocationMethodEnum ipAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().ipAllocationMethod(); + } + + /** + * Set the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withIpAllocationMethod(IpAllocationMethodEnum ipAllocationMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withIpAllocationMethod(ipAllocationMethod); + return this; + } + + /** + * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @return the ipConfigurationReferences value. + */ + public List ipConfigurationReferences() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurationReferences(); + } + + /** + * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @param ipConfigurationReferences the ipConfigurationReferences value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withIpConfigurationReferences( + List ipConfigurationReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withIpConfigurationReferences(ipConfigurationReferences); + return this; + } + + /** + * Get the routeTable property: RouteTable for the subnet. + * + * @return the routeTable value. + */ + public ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable() { + return this.innerProperties() == null ? null : this.innerProperties().routeTable(); + } + + /** + * Set the routeTable property: RouteTable for the subnet. + * + * @param routeTable the routeTable value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withRouteTable( + ComponentsI4F0MhSchemasVirtualnetworkpropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withRouteTable(routeTable); + return this; + } + + /** + * Get the vlan property: Vlan to use for the subnet. + * + * @return the vlan value. + */ + public Integer vlan() { + return this.innerProperties() == null ? null : this.innerProperties().vlan(); + } + + /** + * Set the vlan property: Vlan to use for the subnet. + * + * @param vlan the vlan value to set. + * @return the VirtualNetworkPropertiesSubnetsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsItem withVlan(Integer vlan) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withVlan(vlan); + 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference.java new file mode 100644 index 0000000000000..6b2cd341de66f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IPConfigurationReference - Describes a IPConfiguration under the virtual network. */ +@Fluent +public final class VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference { + /* + * IPConfigurationID + */ + @JsonProperty(value = "ID") + private String id; + + /** Creates an instance of VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference class. */ + public VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference() { + } + + /** + * Get the id property: IPConfigurationID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: IPConfigurationID. + * + * @param id the id value to set. + * @return the VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference object itself. + */ + public VirtualNetworkPropertiesSubnetsItemAutoGeneratedIpConfigurationReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsPropertiesItemsItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsPropertiesItemsItem.java new file mode 100644 index 0000000000000..ea866d40fd20c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkPropertiesSubnetsPropertiesItemsItem.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route is associated with a subnet. */ +@Fluent +public final class VirtualNetworkPropertiesSubnetsPropertiesItemsItem { + /* + * Name - name of the subnet + */ + @JsonProperty(value = "name") + private String name; + + /* + * RoutePropertiesFormat - Properties of the route. + */ + @JsonProperty(value = "properties") + private VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem innerProperties; + + /** Creates an instance of VirtualNetworkPropertiesSubnetsPropertiesItemsItem class. */ + public VirtualNetworkPropertiesSubnetsPropertiesItemsItem() { + } + + /** + * Get the name property: Name - name of the subnet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - name of the subnet. + * + * @param name the name value to set. + * @return the VirtualNetworkPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: RoutePropertiesFormat - Properties of the route. + * + * @return the innerProperties value. + */ + private VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem innerProperties() { + return this.innerProperties; + } + + /** + * Get the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Set the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualNetworkPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsPropertiesItemsItem withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().nextHopIpAddress(); + } + + /** + * Set the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualNetworkPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualNetworkPropertiesSubnetsPropertiesItemsItem withNextHopIpAddress(String nextHopIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesSubnetsItemRouteTableRoutesItem(); + } + this.innerProperties().withNextHopIpAddress(nextHopIpAddress); + 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatus.java new file mode 100644 index 0000000000000..90e8b17122819 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatus.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The observed state of virtual networks. */ +@Fluent +public final class VirtualNetworkStatus { + /* + * VirtualNetwork provisioning error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The provisioningStatus property. + */ + @JsonProperty(value = "provisioningStatus") + private VirtualNetworkStatusProvisioningStatus provisioningStatus; + + /** Creates an instance of VirtualNetworkStatus class. */ + public VirtualNetworkStatus() { + } + + /** + * Get the errorCode property: VirtualNetwork provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: VirtualNetwork provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the VirtualNetworkStatus object itself. + */ + public VirtualNetworkStatus withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive error message. + * + * @param errorMessage the errorMessage value to set. + * @return the VirtualNetworkStatus object itself. + */ + public VirtualNetworkStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public VirtualNetworkStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the VirtualNetworkStatus object itself. + */ + public VirtualNetworkStatus withProvisioningStatus(VirtualNetworkStatusProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningStatus() != null) { + provisioningStatus().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatusProvisioningStatus.java new file mode 100644 index 0000000000000..0e4a63000f7b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworkStatusProvisioningStatus.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualNetworkStatusProvisioningStatus model. */ +@Fluent +public final class VirtualNetworkStatusProvisioningStatus { + /* + * The ID of the operation performed on the virtual network + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * The status of the operation performed on the virtual network [Succeeded, Failed, InProgress] + */ + @JsonProperty(value = "status") + private Status status; + + /** Creates an instance of VirtualNetworkStatusProvisioningStatus class. */ + public VirtualNetworkStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the virtual network. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the virtual network. + * + * @param operationId the operationId value to set. + * @return the VirtualNetworkStatusProvisioningStatus object itself. + */ + public VirtualNetworkStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the virtual network [Succeeded, Failed, + * InProgress]. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the operation performed on the virtual network [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the VirtualNetworkStatusProvisioningStatus object itself. + */ + public VirtualNetworkStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworks.java new file mode 100644 index 0000000000000..910a2200ac567 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworks.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworks. */ +public interface VirtualNetworks { + /** + * 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 extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + * + * @return the dhcpOptions value. + */ + VirtualNetworkPropertiesDhcpOptions dhcpOptions(); + + /** + * Gets the networkType property: Type of the network. + * + * @return the networkType value. + */ + NetworkTypeEnum networkType(); + + /** + * Gets the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the provisioningState property: Provisioning state of the virtual network. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the vmSwitchName property: name of the network switch to be used for VMs. + * + * @return the vmSwitchName value. + */ + String vmSwitchName(); + + /** + * Gets the status property: The observed state of virtual networks. + * + * @return the status value. + */ + VirtualNetworkStatus status(); + + /** + * 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.azurestackhci.fluent.models.VirtualNetworksInner object. + * + * @return the inner object. + */ + VirtualNetworksInner innerModel(); + + /** The entirety of the VirtualNetworks definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The VirtualNetworks definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworks definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the VirtualNetworks 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 VirtualNetworks 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 VirtualNetworks 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.WithExtendedLocation, + DefinitionStages.WithDhcpOptions, + DefinitionStages.WithNetworkType, + DefinitionStages.WithSubnets, + DefinitionStages.WithVmSwitchName { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworks create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworks create(Context context); + } + + /** The stage of the VirtualNetworks 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 VirtualNetworks definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** The stage of the VirtualNetworks definition allowing to specify dhcpOptions. */ + interface WithDhcpOptions { + /** + * Specifies the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs + * deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.. + * + * @param dhcpOptions DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual + * network. Standard DHCP option for a subnet overrides VNET DHCP options. + * @return the next definition stage. + */ + WithCreate withDhcpOptions(VirtualNetworkPropertiesDhcpOptions dhcpOptions); + } + + /** The stage of the VirtualNetworks definition allowing to specify networkType. */ + interface WithNetworkType { + /** + * Specifies the networkType property: Type of the network. + * + * @param networkType Type of the network. + * @return the next definition stage. + */ + WithCreate withNetworkType(NetworkTypeEnum networkType); + } + + /** The stage of the VirtualNetworks definition allowing to specify subnets. */ + interface WithSubnets { + /** + * Specifies the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets Subnet - list of subnets under the virtual network. + * @return the next definition stage. + */ + WithCreate withSubnets(List subnets); + } + + /** The stage of the VirtualNetworks definition allowing to specify vmSwitchName. */ + interface WithVmSwitchName { + /** + * Specifies the vmSwitchName property: name of the network switch to be used for VMs. + * + * @param vmSwitchName name of the network switch to be used for VMs. + * @return the next definition stage. + */ + WithCreate withVmSwitchName(String vmSwitchName); + } + } + + /** + * Begins update for the VirtualNetworks resource. + * + * @return the stage of resource update. + */ + VirtualNetworks.Update update(); + + /** The template for VirtualNetworks update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworks apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworks apply(Context context); + } + + /** The VirtualNetworks update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworks update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworks refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworks refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksListResult.java new file mode 100644 index 0000000000000..63d69870d4f89 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksListResult.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualNetworksInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualNetworksListResult model. */ +@Fluent +public final class VirtualNetworksListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VirtualNetworksListResult class. */ + public VirtualNetworksListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualNetworksListResult object itself. + */ + public VirtualNetworksListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworksListResult object itself. + */ + public VirtualNetworksListResult 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksOperations.java new file mode 100644 index 0000000000000..4673aa1cf49d0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksOperations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 VirtualNetworksOperations. */ +public interface VirtualNetworksOperations { + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtual network resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, Context context); + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtual network resource definition. + */ + VirtualNetworks getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @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 virtualNetworkName); + + /** + * The operation to delete a virtual network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the virtual networks in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual networks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the virtual networks in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual networks. + * + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * The getByResourceGroup operation. + * + * @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 the virtual network resource definition along with {@link Response}. + */ + VirtualNetworks getById(String id); + + /** + * The getByResourceGroup operation. + * + * @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 virtual network resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a virtual network. + * + * @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); + + /** + * The operation to delete a virtual network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualNetworks resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworks definition. + */ + VirtualNetworks.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksUpdateRequest.java new file mode 100644 index 0000000000000..edce099bcc7a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualNetworksUpdateRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtual network resource patch definition. */ +@Fluent +public final class VirtualNetworksUpdateRequest { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of VirtualNetworksUpdateRequest class. */ + public VirtualNetworksUpdateRequest() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualNetworksUpdateRequest object itself. + */ + public VirtualNetworksUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VmSizeEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VmSizeEnum.java new file mode 100644 index 0000000000000..c5b18f143119e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VmSizeEnum.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VmSizeEnum. */ +public final class VmSizeEnum extends ExpandableStringEnum { + /** Static value Default for VmSizeEnum. */ + public static final VmSizeEnum DEFAULT = fromString("Default"); + + /** Static value Standard_A2_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_A2_V2 = fromString("Standard_A2_v2"); + + /** Static value Standard_A4_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_A4_V2 = fromString("Standard_A4_v2"); + + /** Static value Standard_D2s_v3 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); + + /** Static value Standard_D4s_v3 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); + + /** Static value Standard_D8s_v3 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); + + /** Static value Standard_D16s_v3 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); + + /** Static value Standard_D32s_v3 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); + + /** Static value Standard_DS2_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); + + /** Static value Standard_DS3_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); + + /** Static value Standard_DS4_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); + + /** Static value Standard_DS5_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); + + /** Static value Standard_DS13_v2 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); + + /** Static value Standard_K8S_v1 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_K8S_V1 = fromString("Standard_K8S_v1"); + + /** Static value Standard_K8S2_v1 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_K8S2_V1 = fromString("Standard_K8S2_v1"); + + /** Static value Standard_K8S3_v1 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_K8S3_V1 = fromString("Standard_K8S3_v1"); + + /** Static value Standard_K8S4_v1 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_K8S4_V1 = fromString("Standard_K8S4_v1"); + + /** Static value Standard_NK6 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_NK6 = fromString("Standard_NK6"); + + /** Static value Standard_NK12 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_NK12 = fromString("Standard_NK12"); + + /** Static value Standard_NV6 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_NV6 = fromString("Standard_NV6"); + + /** Static value Standard_NV12 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_NV12 = fromString("Standard_NV12"); + + /** Static value Standard_K8S5_v1 for VmSizeEnum. */ + public static final VmSizeEnum STANDARD_K8S5_V1 = fromString("Standard_K8S5_v1"); + + /** Static value Custom for VmSizeEnum. */ + public static final VmSizeEnum CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of VmSizeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VmSizeEnum() { + } + + /** + * Creates or finds a VmSizeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VmSizeEnum. + */ + @JsonCreator + public static VmSizeEnum fromString(String name) { + return fromString(name, VmSizeEnum.class); + } + + /** + * Gets known VmSizeEnum values. + * + * @return known VmSizeEnum values. + */ + public static Collection values() { + return values(VmSizeEnum.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java deleted file mode 100644 index 6d9da4e53ba78..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.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.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for WindowsServerSubscription. */ -public final class WindowsServerSubscription extends ExpandableStringEnum { - /** Static value Disabled for WindowsServerSubscription. */ - public static final WindowsServerSubscription DISABLED = fromString("Disabled"); - - /** Static value Enabled for WindowsServerSubscription. */ - public static final WindowsServerSubscription ENABLED = fromString("Enabled"); - - /** - * Creates or finds a WindowsServerSubscription from its string representation. - * - * @param name a name to look for. - * @return the corresponding WindowsServerSubscription. - */ - @JsonCreator - public static WindowsServerSubscription fromString(String name) { - return fromString(name, WindowsServerSubscription.class); - } - - /** - * Gets known WindowsServerSubscription values. - * - * @return known WindowsServerSubscription values. - */ - public static Collection values() { - return values(WindowsServerSubscription.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java deleted file mode 100644 index 47e9f75aa33b3..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for ArcSettings CreateIdentity. */ -public final class ArcSettingsCreateIdentitySamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json - */ - /** - * Sample code: Create Arc Identity. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java deleted file mode 100644 index b0da37f7e07eb..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java +++ /dev/null @@ -1,20 +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.azurestackhci.generated; - -/** Samples for ArcSettings Create. */ -public final class ArcSettingsCreateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json - */ - /** - * Sample code: Create ArcSetting. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java deleted file mode 100644 index dd70b83175554..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for ArcSettings Delete. */ -public final class ArcSettingsDeleteSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json - */ - /** - * Sample code: Delete ArcSetting. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().delete("test-rg", "myCluster", "default", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java deleted file mode 100644 index 066deffefc05c..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for ArcSettings GeneratePassword. */ -public final class ArcSettingsGeneratePasswordSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json - */ - /** - * Sample code: Generate Password. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java deleted file mode 100644 index 9b49a686cf00e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for ArcSettings Get. */ -public final class ArcSettingsGetSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json - */ - /** - * Sample code: Get ArcSetting. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java deleted file mode 100644 index bfc08f7891a47..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java +++ /dev/null @@ -1,35 +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.azurestackhci.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.io.IOException; - -/** Samples for ArcSettings Update. */ -public final class ArcSettingsUpdateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json - */ - /** - * Sample code: Patch ArcSetting. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { - ArcSetting resource = - manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE).getValue(); - resource - .update() - .withConnectivityProperties( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"enabled\":true}", Object.class, SerializerEncoding.JSON)) - .apply(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java deleted file mode 100644 index 2e5a4bc4c68c1..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java +++ /dev/null @@ -1,28 +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.azurestackhci.generated; - -/** Samples for Clusters Create. */ -public final class ClustersCreateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json - */ - /** - * Sample code: Create cluster. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager - .clusters() - .define("myCluster") - .withRegion("East US") - .withExistingResourceGroup("test-rg") - .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") - .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") - .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") - .create(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java deleted file mode 100644 index 087f8a22c28b4..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for Clusters Delete. */ -public final class ClustersDeleteSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json - */ - /** - * Sample code: Delete cluster. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().delete("test-rg", "myCluster", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java deleted file mode 100644 index fb08e4f84c922..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for Clusters GetByResourceGroup. */ -public final class ClustersGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json - */ - /** - * Sample code: Get cluster. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java deleted file mode 100644 index 0604ed772ffc9..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java +++ /dev/null @@ -1,49 +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.azurestackhci.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Clusters Update. */ -public final class ClustersUpdateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json - */ - /** - * Sample code: Update cluster. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - Cluster resource = - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") - .withDesiredProperties( - new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.ENABLED) - .withDiagnosticLevel(DiagnosticLevel.BASIC)) - .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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java deleted file mode 100644 index e0b951ddce12a..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java +++ /dev/null @@ -1,33 +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.azurestackhci.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; -import java.util.Arrays; - -/** Samples for Clusters UploadCertificate. */ -public final class ClustersUploadCertificateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json - */ - /** - * Sample code: Upload certificate. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager - .clusters() - .uploadCertificate( - "test-rg", - "myCluster", - new UploadCertificateRequest() - .withProperties( - new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), - Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java deleted file mode 100644 index b25518c9e8777..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.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.azurestackhci.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** Samples for Extensions Create. */ -public final class ExtensionsCreateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json - */ - /** - * Sample code: Create Arc Extension. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { - manager - .extensions() - .define("MicrosoftMonitoringAgent") - .withExistingArcSetting("test-rg", "myCluster", "default") - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .withProtectedSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .create(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java deleted file mode 100644 index 6cf05532d2646..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for Extensions Get. */ -public final class ExtensionsGetSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json - */ - /** - * Sample code: Get ArcSettings Extension. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager - .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java deleted file mode 100644 index 382bea80ca758..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java +++ /dev/null @@ -1,41 +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.azurestackhci.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import java.io.IOException; - -/** Samples for Extensions Update. */ -public final class ExtensionsUpdateSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json - */ - /** - * Sample code: Update Arc Extension. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) - throws IOException { - Extension resource = - manager - .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) - .getValue(); - resource - .update() - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) - .apply(); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..dd462ed836eaf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; + +/** Samples for GalleryImagesOperation CreateOrUpdate. */ +public final class GalleryImagesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutGalleryImage.json + */ + /** + * Sample code: PutGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryImagesOperations() + .define("test-gallery-image") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withContainerId("Default_Container") + .withImagePath("C:\\test.vhdx") + .withOsType(OperatingSystemTypes.LINUX) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationDeleteSamples.java similarity index 50% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationDeleteSamples.java index e89be94c7633b..584831f42aa30 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationDeleteSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for Extensions Delete. */ -public final class ExtensionsDeleteSamples { +/** Samples for GalleryImagesOperation Delete. */ +public final class GalleryImagesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteGalleryImage.json */ /** - * Sample code: Delete Arc Extension. + * Sample code: DeleteGalleryImage. * * @param manager Entry point to AzureStackHciManager. */ - public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + public static void deleteGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryImagesOperations().delete("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..09f9b0dc5d743 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for GalleryImagesOperation GetByResourceGroup. */ +public final class GalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetGalleryImage.json + */ + /** + * Sample code: GetGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryImagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..5906f56565402 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for GalleryImagesOperation ListByResourceGroup. */ +public final class GalleryImagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListGalleryImageByResourceGroup.json + */ + /** + * Sample code: ListGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryImagesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListSamples.java similarity index 54% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListSamples.java index 2d619de3c1662..ec05985717992 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for Clusters List. */ -public final class ClustersListSamples { +/** Samples for GalleryImagesOperation List. */ +public final class GalleryImagesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListGalleryImageBySubscription.json */ /** - * Sample code: List clusters in a given subscription. + * Sample code: ListGalleryImageBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void listClustersInAGivenSubscription( + public static void listGalleryImageBySubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().list(Context.NONE); + manager.galleryImagesOperations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationUpdateSamples.java new file mode 100644 index 0000000000000..df2e020036b41 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GalleryImagesOperation Update. */ +public final class GalleryImagesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateGalleryImage.json + */ + /** + * Sample code: UpdateGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + GalleryImages resource = + manager + .galleryImagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentCreateSamples.java new file mode 100644 index 0000000000000..a39880075885e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentCreateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; + +/** Samples for GuestAgent Create. */ +public final class GuestAgentCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/CreateGuestAgent.json + */ + /** + * Sample code: CreateGuestAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new GuestAgentInner() + .withCredentials( + new GuestCredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) + .withProvisioningAction(ProvisioningAction.INSTALL), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentDeleteSamples.java new file mode 100644 index 0000000000000..2b59a675a230f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentDeleteSamples.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.azurestackhci.generated; + +/** Samples for GuestAgent Delete. */ +public final class GuestAgentDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteGuestAgent.json + */ + /** + * Sample code: DeleteGuestAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentGetSamples.java new file mode 100644 index 0000000000000..ae0e771728b81 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentGetSamples.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.azurestackhci.generated; + +/** Samples for GuestAgent Get. */ +public final class GuestAgentGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetGuestAgent.json + */ + /** + * Sample code: GetGuestAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getGuestAgent(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgents() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentsOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentsOperationListSamples.java new file mode 100644 index 0000000000000..bee32db7c46c1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentsOperationListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for GuestAgentsOperation List. */ +public final class GuestAgentsOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GuestAgent_List.json + */ + /** + * Sample code: GuestAgentListByVirtualMachineInstances. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void guestAgentListByVirtualMachineInstances( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .guestAgentsOperations() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataGetSamples.java new file mode 100644 index 0000000000000..b805a0e3fd6eb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataGetSamples.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.azurestackhci.generated; + +/** Samples for HybridIdentityMetadata Get. */ +public final class HybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetHybridIdentityMetadata.json + */ + /** + * Sample code: GetHybridIdentityMetadata. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getHybridIdentityMetadata(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .hybridIdentityMetadatas() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataListSamples.java new file mode 100644 index 0000000000000..c8f69aa064f3f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for HybridIdentityMetadata List. */ +public final class HybridIdentityMetadataListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/HybridIdentityMetadata_List.json + */ + /** + * Sample code: HybridIdentityMetadataListByVirtualMachineInstances. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void hybridIdentityMetadataListByVirtualMachineInstances( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .hybridIdentityMetadatas() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3b8b964547755 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion; +import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; + +/** Samples for MarketplaceGalleryImagesOperation CreateOrUpdate. */ +public final class MarketplaceGalleryImagesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutMarketplaceGalleryImage.json + */ + /** + * Sample code: PutMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .marketplaceGalleryImagesOperations() + .define("test-marketplace-gallery-image") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withContainerId("Default_Container") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCloudInitDataSource(CloudInitDataSource.AZURE) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .withVersion(new GalleryImageVersion().withName("1.0.0")) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationDeleteSamples.java new file mode 100644 index 0000000000000..f14f6497b5ecf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationDeleteSamples.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.azurestackhci.generated; + +/** Samples for MarketplaceGalleryImagesOperation Delete. */ +public final class MarketplaceGalleryImagesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteMarketplaceGalleryImage.json + */ + /** + * Sample code: DeleteMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .marketplaceGalleryImagesOperations() + .delete("test-rg", "test-marketplace-gallery-image", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..0f245c4f4ffc0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. */ +public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetMarketplaceGalleryImage.json + */ + /** + * Sample code: GetMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .marketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse( + "test-rg", "test-marketplace-gallery-image", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..1a6f9ee5440c5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. */ +public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListMarketplaceGalleryImageByResourceGroup.json + */ + /** + * Sample code: ListMarketplaceGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listMarketplaceGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.marketplaceGalleryImagesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListSamples.java new file mode 100644 index 0000000000000..7658aa8c8c6a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListSamples.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.azurestackhci.generated; + +/** Samples for MarketplaceGalleryImagesOperation List. */ +public final class MarketplaceGalleryImagesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListMarketplaceGalleryImageBySubscription.json + */ + /** + * Sample code: ListMarketplaceGalleryImageBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listMarketplaceGalleryImageBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.marketplaceGalleryImagesOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationUpdateSamples.java new file mode 100644 index 0000000000000..93b8ccfdc7f9c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImages; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MarketplaceGalleryImagesOperation Update. */ +public final class MarketplaceGalleryImagesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateMarketplaceGalleryImage.json + */ + /** + * Sample code: UpdateMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + MarketplaceGalleryImages resource = + manager + .marketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse( + "test-rg", "test-marketplce-gallery-image", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5cfddbd966a6a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; +import java.util.Arrays; + +/** Samples for NetworkInterfacesOperation CreateOrUpdate. */ +public final class NetworkInterfacesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutNetworkInterface.json + */ + /** + * Sample code: PutNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkInterfacesOperations() + .define("test-nic") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withIpConfigurations( + Arrays + .asList( + new IpConfiguration() + .withName("ipconfig-sample") + .withProperties( + new IpConfigurationProperties() + .withSubnet(new IpConfigurationPropertiesSubnet().withId("test-vnet"))))) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationDeleteSamples.java new file mode 100644 index 0000000000000..272a179ee19e4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for NetworkInterfacesOperation Delete. */ +public final class NetworkInterfacesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteNetworkInterface.json + */ + /** + * Sample code: DeleteNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkInterfacesOperations().delete("test-rg", "test-nic", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..b856fdf4dfc2f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for NetworkInterfacesOperation GetByResourceGroup. */ +public final class NetworkInterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetNetworkInterface.json + */ + /** + * Sample code: GetNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkInterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d9b07e61a7c5b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for NetworkInterfacesOperation ListByResourceGroup. */ +public final class NetworkInterfacesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListNetworkInterfaceByResourceGroup.json + */ + /** + * Sample code: ListNetworkInterfaceByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listNetworkInterfaceByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkInterfacesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListSamples.java similarity index 52% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListSamples.java index 3bdd3e7609713..d6ae452717da5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for Clusters ListByResourceGroup. */ -public final class ClustersListByResourceGroupSamples { +/** Samples for NetworkInterfacesOperation List. */ +public final class NetworkInterfacesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListNetworkInterfaceBySubscription.json */ /** - * Sample code: List clusters in a given resource group. + * Sample code: ListNetworkInterfaceBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void listClustersInAGivenResourceGroup( + public static void listNetworkInterfaceBySubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().listByResourceGroup("test-rg", Context.NONE); + manager.networkInterfacesOperations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationUpdateSamples.java new file mode 100644 index 0000000000000..d6d6148182284 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaces; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkInterfacesOperation Update. */ +public final class NetworkInterfacesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateNetworkInterface.json + */ + /** + * Sample code: UpdateNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + NetworkInterfaces resource = + manager + .networkInterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java deleted file mode 100644 index 7dc158cda4c3c..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java +++ /dev/null @@ -1,22 +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.azurestackhci.generated; - -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json - */ - /** - * Sample code: Create cluster. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().listWithResponse(Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9f0a20bed89c5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; + +/** Samples for StorageContainersOperation CreateOrUpdate. */ +public final class StorageContainersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutStorageContainer.json + */ + /** + * Sample code: PutStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storageContainersOperations() + .define("Default_Container") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withPath("C:\\container_storage") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationDeleteSamples.java new file mode 100644 index 0000000000000..d13d94e16c1e6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for StorageContainersOperation Delete. */ +public final class StorageContainersOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteStorageContainer.json + */ + /** + * Sample code: DeleteStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().delete("test-rg", "Default_Container", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..5cba44c39e8fe --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for StorageContainersOperation GetByResourceGroup. */ +public final class StorageContainersOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetStorageContainer.json + */ + /** + * Sample code: GetStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0e8a49bd42c2f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for StorageContainersOperation ListByResourceGroup. */ +public final class StorageContainersOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListStorageContainerByResourceGroup.json + */ + /** + * Sample code: ListStorageContainerByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListSamples.java similarity index 52% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListSamples.java index 840759606cea0..7516a30d06833 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for ArcSettings ListByCluster. */ -public final class ArcSettingsListByClusterSamples { +/** Samples for StorageContainersOperation List. */ +public final class StorageContainersOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListStorageContainerBySubscription.json */ /** - * Sample code: List ArcSetting resources by HCI Cluster. + * Sample code: ListStorageContainerBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void listArcSettingResourcesByHCICluster( + public static void listStorageContainerBySubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().listByCluster("test-rg", "myCluster", Context.NONE); + manager.storageContainersOperations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationUpdateSamples.java new file mode 100644 index 0000000000000..4af89f4491024 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.StorageContainers; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageContainersOperation Update. */ +public final class StorageContainersOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateStorageContainer.json + */ + /** + * Sample code: UpdateStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + StorageContainers resource = + manager + .storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4deff2904f137 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; + +/** Samples for VirtualHardDisksOperation CreateOrUpdate. */ +public final class VirtualHardDisksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualHardDisk.json + */ + /** + * Sample code: PutVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualHardDisksOperations() + .define("test-vhd") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withDiskSizeGB(32L) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationDeleteSamples.java similarity index 50% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationDeleteSamples.java index 076cc9c75fbce..fba5c52788df4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationDeleteSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for Clusters CreateIdentity. */ -public final class ClustersCreateIdentitySamples { +/** Samples for VirtualHardDisksOperation Delete. */ +public final class VirtualHardDisksOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualHardDisk.json */ /** - * Sample code: Create cluster Identity. + * Sample code: DeleteVirtualHardDisk. * * @param manager Entry point to AzureStackHciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + public static void deleteVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualHardDisksOperations().delete("test-rg", "test-vhd", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..ad09ab2cc3e2d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for VirtualHardDisksOperation GetByResourceGroup. */ +public final class VirtualHardDisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualHardDisk.json + */ + /** + * Sample code: GetVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..12ce8bff8199e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for VirtualHardDisksOperation ListByResourceGroup. */ +public final class VirtualHardDisksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualHardDisksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListSamples.java similarity index 50% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListSamples.java index 8206a6b61cd70..4e9718ef8892e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - -/** Samples for Extensions ListByArcSetting. */ -public final class ExtensionsListByArcSettingSamples { +/** Samples for VirtualHardDisksOperation List. */ +public final class VirtualHardDisksOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualHardDiskBySubscription.json */ /** - * Sample code: List Extensions under ArcSetting resource. + * Sample code: ListVirtualHardDiskBySubscription. * * @param manager Entry point to AzureStackHciManager. */ - public static void listExtensionsUnderArcSettingResource( + public static void listVirtualHardDiskBySubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + manager.virtualHardDisksOperations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationUpdateSamples.java new file mode 100644 index 0000000000000..d4990c38e9265 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualHardDisksOperation Update. */ +public final class VirtualHardDisksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualHardDisk.json + */ + /** + * Sample code: UpdateVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + VirtualHardDisks resource = + manager + .virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8ff85a1364a42 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesCreateOrUpdateSamples.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk; +import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; +import java.util.Arrays; + +/** Samples for VirtualMachineInstances CreateOrUpdate. */ +public final class VirtualMachineInstancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithGalleryImage.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithOsDisk.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithOsDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithOsDisk( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withOsDisk( + new VirtualMachineInstancePropertiesStorageProfileOsDisk() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithMarketplaceGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithMarketplaceGalleryImage( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualMachineInstanceWithVMConfigAgent.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithVMConfigAgent. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachineInstanceWithVMConfigAgent( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withHardwareProfile( + new VirtualMachineInstancePropertiesHardwareProfile().withVmSize(VmSizeEnum.DEFAULT)) + .withNetworkProfile( + new VirtualMachineInstancePropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withOsProfile( + new VirtualMachineInstancePropertiesOsProfile() + .withAdminPassword("fakeTokenPlaceholder") + .withAdminUsername("localadmin") + .withComputerName("luamaster") + .withWindowsConfiguration( + new VirtualMachineInstancePropertiesOsProfileWindowsConfiguration() + .withProvisionVMConfigAgent(true))) + .withSecurityProfile( + new VirtualMachineInstancePropertiesSecurityProfile() + .withEnableTpm(true) + .withUefiSettings( + new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile( + new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference( + new VirtualMachineInstancePropertiesStorageProfileImageReference() + .withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesDeleteSamples.java new file mode 100644 index 0000000000000..ca3d511afa599 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesDeleteSamples.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.azurestackhci.generated; + +/** Samples for VirtualMachineInstances Delete. */ +public final class VirtualMachineInstancesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualMachineInstance.json + */ + /** + * Sample code: DeleteVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesGetSamples.java new file mode 100644 index 0000000000000..893da3b5170ba --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesGetSamples.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.azurestackhci.generated; + +/** Samples for VirtualMachineInstances Get. */ +public final class VirtualMachineInstancesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualMachineInstance.json + */ + /** + * Sample code: GetVirtualMachineInstance. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualMachineInstance(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesListSamples.java new file mode 100644 index 0000000000000..ea5e569d688dc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for VirtualMachineInstances List. */ +public final class VirtualMachineInstancesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualMachineInstances.json + */ + /** + * Sample code: ListVirtualMachineInstances. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineInstances( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesRestartSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesRestartSamples.java new file mode 100644 index 0000000000000..cf6547eef5a14 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesRestartSamples.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.azurestackhci.generated; + +/** Samples for VirtualMachineInstances Restart. */ +public final class VirtualMachineInstancesRestartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/RestartVirtualMachineInstance.json + */ + /** + * Sample code: RestartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStartSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStartSamples.java new file mode 100644 index 0000000000000..22fad43eab193 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStartSamples.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.azurestackhci.generated; + +/** Samples for VirtualMachineInstances Start. */ +public final class VirtualMachineInstancesStartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/StartVirtualMachineInstance.json + */ + /** + * Sample code: StartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStopSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStopSamples.java new file mode 100644 index 0000000000000..c01040e48d341 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStopSamples.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.azurestackhci.generated; + +/** Samples for VirtualMachineInstances Stop. */ +public final class VirtualMachineInstancesStopSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/StopVirtualMachineInstance.json + */ + /** + * Sample code: StopVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/DemoArcVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesUpdateSamples.java new file mode 100644 index 0000000000000..1dc987353a105 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateProperties; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; + +/** Samples for VirtualMachineInstances Update. */ +public final class VirtualMachineInstancesUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualMachineInstance.json + */ + /** + * Sample code: UpdateVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualMachineInstances() + .update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceUpdateRequest() + .withProperties(new VirtualMachineInstanceUpdateProperties().withOsProfile(new OsProfileUpdate())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3b1e8453446a1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.NetworkTypeEnum; + +/** Samples for VirtualNetworksOperation CreateOrUpdate. */ +public final class VirtualNetworksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/PutVirtualNetwork.json + */ + /** + * Sample code: PutVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualNetworksOperations() + .define("test-vnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withNetworkType(NetworkTypeEnum.TRANSPARENT) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationDeleteSamples.java new file mode 100644 index 0000000000000..9264d2b99272d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for VirtualNetworksOperation Delete. */ +public final class VirtualNetworksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/DeleteVirtualNetwork.json + */ + /** + * Sample code: DeleteVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().delete("test-rg", "test-vnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..79e878c5398aa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for VirtualNetworksOperation GetByResourceGroup. */ +public final class VirtualNetworksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/GetVirtualNetwork.json + */ + /** + * Sample code: GetVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..6bdf43c5265a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListByResourceGroupSamples.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.azurestackhci.generated; + +/** Samples for VirtualNetworksOperation ListByResourceGroup. */ +public final class VirtualNetworksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ + /** + * Sample code: ListVirtualNetworkByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListSamples.java new file mode 100644 index 0000000000000..6ee03678f95f8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationListSamples.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.azurestackhci.generated; + +/** Samples for VirtualNetworksOperation List. */ +public final class VirtualNetworksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/ListVirtualNetworkBySubscription.json + */ + /** + * Sample code: ListVirtualNetworkBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualNetworksOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationUpdateSamples.java new file mode 100644 index 0000000000000..6aa402d68dbb1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualNetworksOperationUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.VirtualNetworks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworksOperation Update. */ +public final class VirtualNetworksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-07-01-preview/examples/UpdateVirtualNetwork.json + */ + /** + * Sample code: UpdateVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + VirtualNetworks resource = + manager + .virtualNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +}