diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index cbb537d7d6e6..2728ce54d056 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.6 (Unreleased) +## 1.0.0-beta.1 (2025-01-27) + +- 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-2024-01. 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 1084ff088247..ebb9f434bb45 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager AzureStackHci client library for Java +# Azure Resource Manager azurestackhci client library for Java -Azure Resource Manager AzureStackHci client library for Java. +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-2024-04. 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-2024-01. 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.5 + 1.0.0-beta.6 ``` [//]: # ({x-version-update-end}) @@ -56,7 +56,7 @@ AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -AzureStackHciManager manager = AzureStackHciManager +AzurestackhciManager manager = AzurestackhciManager .authenticate(credential, profile); ``` diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 7554e89c4185..a70179615642 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -15,7 +15,6 @@ ## Clusters -- [ConfigureRemoteSupport](#clusters_configureremotesupport) - [Create](#clusters_create) - [CreateIdentity](#clusters_createidentity) - [Delete](#clusters_delete) @@ -23,7 +22,6 @@ - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) -- [TriggerLogCollection](#clusters_triggerlogcollection) - [Update](#clusters_update) - [UploadCertificate](#clusters_uploadcertificate) @@ -51,6 +49,57 @@ - [Update](#extensions_update) - [Upgrade](#extensions_upgrade) +## GalleryImagesOperation + +- [CreateOrUpdate](#galleryimagesoperation_createorupdate) +- [Delete](#galleryimagesoperation_delete) +- [GetByResourceGroup](#galleryimagesoperation_getbyresourcegroup) +- [List](#galleryimagesoperation_list) +- [ListByResourceGroup](#galleryimagesoperation_listbyresourcegroup) +- [Update](#galleryimagesoperation_update) + +## GuestAgent + +- [Create](#guestagent_create) +- [Delete](#guestagent_delete) +- [Get](#guestagent_get) + +## GuestAgentsOperation + +- [List](#guestagentsoperation_list) + +## HybridIdentityMetadata + +- [Get](#hybrididentitymetadata_get) +- [List](#hybrididentitymetadata_list) + +## LogicalNetworksOperation + +- [CreateOrUpdate](#logicalnetworksoperation_createorupdate) +- [Delete](#logicalnetworksoperation_delete) +- [GetByResourceGroup](#logicalnetworksoperation_getbyresourcegroup) +- [List](#logicalnetworksoperation_list) +- [ListByResourceGroup](#logicalnetworksoperation_listbyresourcegroup) +- [Update](#logicalnetworksoperation_update) + +## 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) + ## Offers - [Get](#offers_get) @@ -78,6 +127,15 @@ - [Get](#skus_get) - [ListByOffer](#skus_listbyoffer) +## StorageContainersOperation + +- [CreateOrUpdate](#storagecontainersoperation_createorupdate) +- [Delete](#storagecontainersoperation_delete) +- [GetByResourceGroup](#storagecontainersoperation_getbyresourcegroup) +- [List](#storagecontainersoperation_list) +- [ListByResourceGroup](#storagecontainersoperation_listbyresourcegroup) +- [Update](#storagecontainersoperation_update) + ## UpdateRuns - [Delete](#updateruns_delete) @@ -99,6 +157,26 @@ - [List](#updates_list) - [Post](#updates_post) - [Put](#updates_put) + +## 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) ### ArcSettings_ConsentAndInstallDefaultExtensions ```java @@ -108,16 +186,16 @@ public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ConsentAndInstallDefaultExtensions.json */ /** * Sample code: Consent And Install Default Extensions. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - consentAndInstallDefaultExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + consentAndInstallDefaultExtensions(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .consentAndInstallDefaultExtensionsWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); @@ -134,15 +212,15 @@ public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { public final class ArcSettingsCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutArcSetting. + * json */ /** * Sample code: Create ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); } } @@ -157,15 +235,15 @@ public final class ArcSettingsCreateSamples { public final class ArcSettingsCreateIdentitySamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateArcIdentity.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateArcIdentity + * .json */ /** * Sample code: Create Arc Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().createIdentity("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } @@ -180,15 +258,15 @@ public final class ArcSettingsCreateIdentitySamples { public final class ArcSettingsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteArcSetting. + * json */ /** * Sample code: Delete ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } @@ -203,15 +281,15 @@ public final class ArcSettingsDeleteSamples { public final class ArcSettingsGeneratePasswordSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GeneratePassword.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GeneratePassword. + * json */ /** * Sample code: Generate Password. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .generatePasswordWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } @@ -227,15 +305,15 @@ public final class ArcSettingsGeneratePasswordSamples { public final class ArcSettingsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetArcSetting. + * json */ /** * Sample code: Get ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } @@ -250,15 +328,15 @@ public final class ArcSettingsGetSamples { public final class ArcSettingsInitializeDisableProcessSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * InitializeDisableProcess.json */ /** * Sample code: Trigger ARC Disable. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .initializeDisableProcess("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } @@ -274,16 +352,16 @@ public final class ArcSettingsInitializeDisableProcessSamples { public final class ArcSettingsListByClusterSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listArcSettingResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listArcSettingResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } @@ -303,15 +381,15 @@ import java.io.IOException; public final class ArcSettingsUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PatchArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchArcSetting. + * json */ /** * Sample code: Patch ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { ArcSetting resource = manager.arcSettings() .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE) @@ -325,39 +403,6 @@ public final class ArcSettingsUpdateSamples { } ``` -### Clusters_ConfigureRemoteSupport - -```java -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportType; -import java.time.OffsetDateTime; - -/** - * Samples for Clusters ConfigureRemoteSupport. - */ -public final class ClustersConfigureRemoteSupportSamples { - /* - * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ConfigureRemoteSupport.json - */ - /** - * Sample code: Configure Remote Support. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void configureRemoteSupport(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters() - .configureRemoteSupport("test-rg", "mycluster", - new RemoteSupportRequest().withProperties(new RemoteSupportRequestProperties() - .withExpirationTimestamp(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withRemoteSupportType(RemoteSupportType.ENABLE)), - com.azure.core.util.Context.NONE); - } -} -``` - ### Clusters_Create ```java @@ -369,15 +414,15 @@ import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateCluster. + * json */ /** * Sample code: Create cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .define("myCluster") .withRegion("East US") @@ -400,15 +445,15 @@ public final class ClustersCreateSamples { public final class ClustersCreateIdentitySamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().createIdentity("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } @@ -423,15 +468,15 @@ public final class ClustersCreateIdentitySamples { public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteCluster. + * json */ /** * Sample code: Delete cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().delete("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } @@ -450,15 +495,15 @@ import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; public final class ClustersExtendSoftwareAssuranceBenefitSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ExtendSoftwareAssuranceBenefit.json */ /** * Sample code: Create cluster Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .extendSoftwareAssuranceBenefit("test-rg", "myCluster", new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() @@ -477,15 +522,14 @@ public final class ClustersExtendSoftwareAssuranceBenefitSamples { public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetCluster.json */ /** * Sample code: Get cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } @@ -500,16 +544,16 @@ public final class ClustersGetByResourceGroupSamples { public final class ClustersListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listClustersInAGivenSubscription(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listClustersInAGivenSubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().list(com.azure.core.util.Context.NONE); } } @@ -524,53 +568,21 @@ public final class ClustersListSamples { public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listClustersInAGivenResourceGroup(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listClustersInAGivenResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### Clusters_TriggerLogCollection - -```java -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequestProperties; -import java.time.OffsetDateTime; - -/** - * Samples for Clusters TriggerLogCollection. - */ -public final class ClustersTriggerLogCollectionSamples { - /* - * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * TriggerLogCollection.json - */ - /** - * Sample code: Trigger Log Collection. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void triggerLogCollection(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters() - .triggerLogCollection("test-rg", "mycluster", - new LogCollectionRequest().withProperties(new LogCollectionRequestProperties() - .withFromDate(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withToDate(OffsetDateTime.parse("2021-01-01T17:18:19.1234567Z"))), - com.azure.core.util.Context.NONE); - } -} -``` - ### Clusters_Update ```java @@ -588,15 +600,15 @@ import java.util.Map; public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * UpdateCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateCluster. + * json */ /** * Sample code: Update cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { Cluster resource = manager.clusters() .getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE) .getValue(); @@ -637,15 +649,15 @@ import java.util.Arrays; public final class ClustersUploadCertificateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * UploadCertificate.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UploadCertificate + * .json */ /** * Sample code: Upload certificate. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .uploadCertificate("test-rg", "myCluster", new UploadCertificateRequest().withProperties( @@ -658,35 +670,24 @@ public final class ClustersUploadCertificateSamples { ### DeploymentSettings_CreateOrUpdate ```java +import com.azure.resourcemanager.azurestackhci.models.AdapterPropertyOverrides; import com.azure.resourcemanager.azurestackhci.models.DeploymentCluster; import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration; import com.azure.resourcemanager.azurestackhci.models.DeploymentData; import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; import com.azure.resourcemanager.azurestackhci.models.DeploymentSecuritySettings; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingHostNetwork; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingIntents; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageAdapterIpInfo; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageNetworks; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides; -import com.azure.resourcemanager.azurestackhci.models.EceDeploymentSecrets; -import com.azure.resourcemanager.azurestackhci.models.EceSecrets; +import com.azure.resourcemanager.azurestackhci.models.HostNetwork; import com.azure.resourcemanager.azurestackhci.models.InfrastructureNetwork; +import com.azure.resourcemanager.azurestackhci.models.Intents; import com.azure.resourcemanager.azurestackhci.models.IpPools; -import com.azure.resourcemanager.azurestackhci.models.NetworkController; import com.azure.resourcemanager.azurestackhci.models.Observability; -import com.azure.resourcemanager.azurestackhci.models.OperationType; import com.azure.resourcemanager.azurestackhci.models.OptionalServices; import com.azure.resourcemanager.azurestackhci.models.PhysicalNodes; import com.azure.resourcemanager.azurestackhci.models.QosPolicyOverrides; -import com.azure.resourcemanager.azurestackhci.models.SbeCredentials; -import com.azure.resourcemanager.azurestackhci.models.SbeDeploymentInfo; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerInfo; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerProperties; import com.azure.resourcemanager.azurestackhci.models.ScaleUnits; -import com.azure.resourcemanager.azurestackhci.models.SdnIntegration; import com.azure.resourcemanager.azurestackhci.models.Storage; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.azurestackhci.models.StorageNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualSwitchConfigurationOverrides; import java.util.Arrays; /** @@ -695,15 +696,15 @@ import java.util.Arrays; public final class DeploymentSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * PutDeploymentSettings.json */ /** * Sample code: Create Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings() .define("default") .withExistingCluster("test-rg", "myCluster") @@ -711,97 +712,60 @@ public final class DeploymentSettingsCreateOrUpdateSamples { "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2")) .withDeploymentMode(DeploymentMode.DEPLOY) - .withOperationType(OperationType.CLUSTER_PROVISIONING) - .withDeploymentConfiguration( - new DeploymentConfiguration().withVersion("string") - .withScaleUnits(Arrays.asList(new ScaleUnits() - .withDeploymentData(new DeploymentData() - .withSecuritySettings(new DeploymentSecuritySettings().withHvciProtection(true) - .withDrtmProtection(true) - .withDriftControlEnforced(true) - .withCredentialGuardEnforced(false) - .withSmbSigningEnforced(true) - .withSmbClusterEncryption(false) - .withSideChannelMitigationEnforced(true) - .withBitlockerBootVolume(true) - .withBitlockerDataVolumes(true) - .withWdacEnforced(true)) - .withObservability(new Observability().withStreamingDataClient(true) - .withEuLocation(false) - .withEpisodicDataUpload(true)) - .withCluster(new DeploymentCluster().withName("testHCICluster") - .withWitnessType("Cloud") - .withWitnessPath("Cloud") - .withCloudAccountName("myasestoragacct") - .withAzureServiceEndpoint("core.windows.net")) - .withStorage(new Storage().withConfigurationMode("Express")) - .withNamingPrefix("ms169") - .withDomainFqdn("ASZ1PLab8.nttest.microsoft.com") - .withInfrastructureNetwork(Arrays.asList(new InfrastructureNetwork() - .withSubnetMask("255.255.248.0") - .withGateway("255.255.248.0") - .withIpPools(Arrays.asList( - new IpPools().withStartingAddress("10.57.48.60").withEndingAddress("10.57.48.66"))) - .withDnsServers(Arrays.asList("10.57.50.90")))) - .withPhysicalNodes(Arrays.asList( - new PhysicalNodes().withName("ms169host").withIpv4Address("10.57.51.224"), - new PhysicalNodes().withName("ms154host").withIpv4Address("10.57.53.236"))) - .withHostNetwork(new DeploymentSettingHostNetwork() - .withIntents(Arrays.asList(new DeploymentSettingIntents().withName("Compute_Management") - .withTrafficType(Arrays.asList("Compute", "Management")) - .withAdapter(Arrays.asList("Port2")) - .withOverrideVirtualSwitchConfiguration(false) - .withVirtualSwitchConfigurationOverrides( - new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("True") - .withLoadBalancingAlgorithm("HyperVPort")) - .withOverrideQosPolicy(false) - .withQosPolicyOverrides( - new QosPolicyOverrides().withPriorityValue8021ActionCluster("7") - .withPriorityValue8021ActionSmb("3") - .withBandwidthPercentageSmb("50")) - .withOverrideAdapterProperty(false) - .withAdapterPropertyOverrides( - new DeploymentSettingAdapterPropertyOverrides().withJumboPacket("1514") - .withNetworkDirect("Enabled") - .withNetworkDirectTechnology("iWARP")))) - .withStorageNetworks( - Arrays.asList(new DeploymentSettingStorageNetworks().withName("Storage1Network") - .withNetworkAdapterName("Port3") - .withVlanId("5") - .withStorageAdapterIpInfo(Arrays.asList( - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("string") - .withIpv4Address("10.57.48.60") - .withSubnetMask("255.255.248.0"))))) - .withStorageConnectivitySwitchless(true) - .withEnableStorageAutoIp(false)) - .withSdnIntegration(new SdnIntegration().withNetworkController( - new NetworkController().withMacAddressPoolStart("00-0D-3A-1B-C7-21") - .withMacAddressPoolStop("00-0D-3A-1B-C7-29") - .withNetworkVirtualizationEnabled(true))) - .withAdouPath("OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com") - .withSecretsLocation("fakeTokenPlaceholder") - .withSecrets(Arrays.asList( - new EceDeploymentSecrets().withSecretName("fakeTokenPlaceholder") - .withEceSecretName(EceSecrets.fromString("BMCAdminUserCred")) - .withSecretLocation("fakeTokenPlaceholder"), - new EceDeploymentSecrets().withSecretName("fakeTokenPlaceholder") - .withEceSecretName(EceSecrets.AZURE_STACK_LCMUSER_CREDENTIAL) - .withSecretLocation("fakeTokenPlaceholder"))) - .withOptionalServices(new OptionalServices().withCustomLocation("customLocationName"))) - .withSbePartnerInfo(new SbePartnerInfo() - .withSbeDeploymentInfo(new SbeDeploymentInfo().withVersion("4.0.2309.13") - .withFamily("Gen5") - .withPublisher("Contoso") - .withSbeManifestSource("default") - .withSbeManifestCreationDate(OffsetDateTime.parse("2023-07-25T02:40:33Z"))) - .withPartnerProperties( - Arrays.asList(new SbePartnerProperties().withName("EnableBMCIpV6").withValue("false"), - new SbePartnerProperties().withName("PhoneHomePort").withValue("1653"), - new SbePartnerProperties().withName("BMCSecurityState").withValue("HighSecurity"))) - .withCredentialList( - Arrays.asList(new SbeCredentials().withSecretName("fakeTokenPlaceholder") - .withEceSecretName("fakeTokenPlaceholder") - .withSecretLocation("fakeTokenPlaceholder"))))))) + .withDeploymentConfiguration(new DeploymentConfiguration().withVersion("string") + .withScaleUnits(Arrays.asList(new ScaleUnits().withDeploymentData(new DeploymentData() + .withSecuritySettings(new DeploymentSecuritySettings().withHvciProtection(true) + .withDrtmProtection(true) + .withDriftControlEnforced(true) + .withCredentialGuardEnforced(false) + .withSmbSigningEnforced(true) + .withSmbClusterEncryption(false) + .withSideChannelMitigationEnforced(true) + .withBitlockerBootVolume(true) + .withBitlockerDataVolumes(true) + .withWdacEnforced(true)) + .withObservability(new Observability().withStreamingDataClient(true) + .withEuLocation(false) + .withEpisodicDataUpload(true)) + .withCluster(new DeploymentCluster().withName("testHCICluster") + .withWitnessType("Cloud") + .withWitnessPath("Cloud") + .withCloudAccountName("myasestoragacct") + .withAzureServiceEndpoint("core.windows.net")) + .withStorage(new Storage().withConfigurationMode("Express")) + .withNamingPrefix("ms169") + .withDomainFqdn("ASZ1PLab8.nttest.microsoft.com") + .withInfrastructureNetwork(Arrays.asList(new InfrastructureNetwork().withSubnetMask("255.255.248.0") + .withGateway("255.255.248.0") + .withIpPools(Arrays + .asList(new IpPools().withStartingAddress("10.57.48.60").withEndingAddress("10.57.48.66"))) + .withDnsServers(Arrays.asList("10.57.50.90")))) + .withPhysicalNodes( + Arrays.asList(new PhysicalNodes().withName("ms169host").withIpv4Address("10.57.51.224"), + new PhysicalNodes().withName("ms154host").withIpv4Address("10.57.53.236"))) + .withHostNetwork(new HostNetwork() + .withIntents(Arrays.asList(new Intents().withName("Compute_Management") + .withTrafficType(Arrays.asList("Compute", "Management")) + .withAdapter(Arrays.asList("Port2")) + .withOverrideVirtualSwitchConfiguration(false) + .withVirtualSwitchConfigurationOverrides( + new VirtualSwitchConfigurationOverrides().withEnableIov("True") + .withLoadBalancingAlgorithm("HyperVPort")) + .withOverrideQosPolicy(false) + .withQosPolicyOverrides(new QosPolicyOverrides().withPriorityValue8021ActionCluster("7") + .withPriorityValue8021ActionSmb("3") + .withBandwidthPercentageSmb("50")) + .withOverrideAdapterProperty(false) + .withAdapterPropertyOverrides(new AdapterPropertyOverrides().withJumboPacket("1514") + .withNetworkDirect("Enabled") + .withNetworkDirectTechnology("iWARP")))) + .withStorageNetworks(Arrays.asList(new StorageNetworks().withName("Storage1Network") + .withNetworkAdapterName("Port3") + .withVlanId("5"))) + .withStorageConnectivitySwitchless(true)) + .withAdouPath("OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com") + .withSecretsLocation("fakeTokenPlaceholder") + .withOptionalServices(new OptionalServices().withCustomLocation("customLocationName")))))) .create(); } } @@ -816,15 +780,15 @@ public final class DeploymentSettingsCreateOrUpdateSamples { public final class DeploymentSettingsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * DeleteDeploymentSettings.json */ /** * Sample code: Delete Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } @@ -839,15 +803,15 @@ public final class DeploymentSettingsDeleteSamples { public final class DeploymentSettingsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * GetDeploymentSettings.json */ /** * Sample code: Get Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings() .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } @@ -863,15 +827,15 @@ public final class DeploymentSettingsGetSamples { public final class DeploymentSettingsListByClustersSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListDeploymentSettingsByCluster.json */ /** * Sample code: List Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } @@ -881,8 +845,6 @@ public final class DeploymentSettingsListByClustersSamples { ```java import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDevice; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceProperties; import com.azure.resourcemanager.azurestackhci.models.NicDetail; import java.util.Arrays; @@ -892,30 +854,30 @@ import java.util.Arrays; public final class EdgeDevicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateHciEdgeDevice.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutEdgeDevices. + * json */ /** - * Sample code: Create HCI Edge Device. + * Sample code: Create Edge Device. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createHCIEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createEdgeDevice(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() - .createOrUpdate( - "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", - "default", - new HciEdgeDevice().withProperties(new HciEdgeDeviceProperties().withDeviceConfiguration( - new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("ethernet") - .withInterfaceDescription("NDIS 6.70 ") - .withComponentId("VMBUS{f8615163-df3e-46c5-913f-f2d2f965ed0g} ") - .withDriverVersion("10.0.20348.1547 ") - .withIp4Address("10.10.10.10") - .withSubnetMask("255.255.255.0") - .withDefaultGateway("10.10.10.1") - .withDnsServers(Arrays.asList("100.10.10.1")) - .withDefaultIsolationId("0"))).withDeviceMetadata(""))), - com.azure.core.util.Context.NONE); + .define("default") + .withExistingResourceUri( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1") + .withDeviceConfiguration( + new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("ethernet") + .withInterfaceDescription("NDIS 6.70 ") + .withComponentId("VMBUS{f8615163-df3e-46c5-913f-f2d2f965ed0g} ") + .withDriverVersion("10.0.20348.1547 ") + .withIp4Address("10.10.10.10") + .withSubnetMask("255.255.255.0") + .withDefaultGateway("10.10.10.1") + .withDnsServers(Arrays.asList("100.10.10.1")) + .withDefaultIsolationId("0"))).withDeviceMetadata("")) + .create(); } } ``` @@ -929,15 +891,15 @@ public final class EdgeDevicesCreateOrUpdateSamples { public final class EdgeDevicesDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteEdgeDevices + * .json */ /** * Sample code: Delete Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .delete( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", @@ -955,15 +917,15 @@ public final class EdgeDevicesDeleteSamples { public final class EdgeDevicesGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetEdgeDevices. + * json */ /** * Sample code: Get Edge Device. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getEdgeDevice(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .getWithResponse( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", @@ -981,15 +943,15 @@ public final class EdgeDevicesGetSamples { public final class EdgeDevicesListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListEdgeDevices. + * json */ /** * Sample code: List Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .list( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", @@ -1010,15 +972,15 @@ import java.util.Arrays; public final class EdgeDevicesValidateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ValidateEdgeDevices.json */ /** * Sample code: Validate Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void validateEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void validateEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .validate( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", @@ -1045,15 +1007,14 @@ import java.io.IOException; public final class ExtensionsCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { manager.extensions() .define("MicrosoftMonitoringAgent") @@ -1080,15 +1041,15 @@ public final class ExtensionsCreateSamples { public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteExtension. + * json */ /** * Sample code: Delete Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } @@ -1104,15 +1065,14 @@ public final class ExtensionsDeleteSamples { public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); @@ -1129,16 +1089,16 @@ public final class ExtensionsGetSamples { public final class ExtensionsListByArcSettingSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listExtensionsUnderArcSettingResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listExtensionsUnderArcSettingResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions().listByArcSetting("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } @@ -1159,15 +1119,15 @@ import java.io.IOException; public final class ExtensionsUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PatchExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchExtension. + * json */ /** * Sample code: Update Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { Extension resource = manager.extensions() .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", @@ -1196,15 +1156,15 @@ import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters public final class ExtensionsUpgradeSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * Extensions_Upgrade.json */ /** * Sample code: Upgrade Machine Extensions. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .upgrade("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", new ExtensionUpgradeParameters().withTargetVersion("1.0.18062.0"), com.azure.core.util.Context.NONE); @@ -1212,669 +1172,2249 @@ public final class ExtensionsUpgradeSamples { } ``` -### Offers_Get +### GalleryImagesOperation_CreateOrUpdate ```java +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; + /** - * Samples for Offers Get. + * Samples for GalleryImagesOperation CreateOrUpdate. */ -public final class OffersGetSamples { +public final class GalleryImagesOperationCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetOffer - * .json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutGalleryImage. + * json */ /** - * Sample code: Get Offer. + * Sample code: PutGalleryImage. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.offers() - .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + 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( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container") + .withImagePath("C:\\test.vhdx") + .withOsType(OperatingSystemTypes.LINUX) + .create(); } } ``` -### Offers_ListByCluster +### GalleryImagesOperation_Delete ```java /** - * Samples for Offers ListByCluster. + * Samples for GalleryImagesOperation Delete. */ -public final class OffersListByClusterSamples { +public final class GalleryImagesOperationDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListOffersByCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteGalleryImage.json */ /** - * Sample code: List Offer resources by HCI Cluster. + * Sample code: DeleteGalleryImage. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void - listOfferResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.offers().listByCluster("test-rg", "myCluster", null, com.azure.core.util.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); } } ``` -### Offers_ListByPublisher +### GalleryImagesOperation_GetByResourceGroup ```java /** - * Samples for Offers ListByPublisher. + * Samples for GalleryImagesOperation GetByResourceGroup. */ -public final class OffersListByPublisherSamples { +public final class GalleryImagesOperationGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListOffersByPublisher.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetGalleryImage. + * json */ /** - * Sample code: List Offer resources by publisher for the HCI Cluster. + * Sample code: GetGalleryImage. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listOfferResourcesByPublisherForTheHCICluster( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, com.azure.core.util.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); } } ``` -### Operations_List +### GalleryImagesOperation_List ```java /** - * Samples for Operations List. + * Samples for GalleryImagesOperation List. */ -public final class OperationsListSamples { +public final class GalleryImagesOperationListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/operations/stable/2024-04-01/examples/ - * ListOperations.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListGalleryImageBySubscription.json */ /** - * Sample code: Create cluster. + * Sample code: ListGalleryImageBySubscription. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + public static void + listGalleryImageBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.galleryImagesOperations().list(com.azure.core.util.Context.NONE); } } ``` -### Publishers_Get +### GalleryImagesOperation_ListByResourceGroup ```java /** - * Samples for Publishers Get. + * Samples for GalleryImagesOperation ListByResourceGroup. */ -public final class PublishersGetSamples { +public final class GalleryImagesOperationListByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetPublisher.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListGalleryImageByResourceGroup.json */ /** - * Sample code: Get Publisher. + * Sample code: ListGalleryImageByResourceGroup. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", com.azure.core.util.Context.NONE); + public static void + listGalleryImageByResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.galleryImagesOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### Publishers_ListByCluster +### GalleryImagesOperation_Update ```java +import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Publishers ListByCluster. + * Samples for GalleryImagesOperation Update. */ -public final class PublishersListByClusterSamples { +public final class GalleryImagesOperationUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListPublishersByCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * UpdateGalleryImage.json */ /** - * Sample code: List Publisher resources by HCI Cluster. + * Sample code: UpdateGalleryImage. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void - listPublisherResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.publishers().listByCluster("test-rg", "myCluster", com.azure.core.util.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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### SecuritySettings_CreateOrUpdate +### GuestAgent_Create ```java -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; /** - * Samples for SecuritySettings CreateOrUpdate. + * Samples for GuestAgent Create. */ -public final class SecuritySettingsCreateOrUpdateSamples { +public final class GuestAgentCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutSecuritySettings.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateGuestAgent. + * json */ /** - * Sample code: Create Security Settings. + * Sample code: CreateGuestAgent. * - * @param manager Entry point to AzureStackHciManager. - */ - public static void createSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.securitySettings() - .define("default") - .withExistingCluster("test-rg", "myCluster") - .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) - .create(); + * @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); } } ``` -### SecuritySettings_Delete +### GuestAgent_Delete ```java /** - * Samples for SecuritySettings Delete. + * Samples for GuestAgent Delete. */ -public final class SecuritySettingsDeleteSamples { +public final class GuestAgentDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteSecuritySettings.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteGuestAgent. + * json */ /** - * Sample code: Delete Security Settings. + * Sample code: DeleteGuestAgent. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.securitySettings().delete("test-rg", "myCluster", "default", com.azure.core.util.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); } } ``` -### SecuritySettings_Get +### GuestAgent_Get ```java /** - * Samples for SecuritySettings Get. + * Samples for GuestAgent Get. */ -public final class SecuritySettingsGetSamples { +public final class GuestAgentGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetSecuritySettings.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetGuestAgent. + * json */ /** - * Sample code: Get Security Settings. + * Sample code: GetGuestAgent. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.securitySettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + 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); } } ``` -### SecuritySettings_ListByClusters +### GuestAgentsOperation_List ```java /** - * Samples for SecuritySettings ListByClusters. + * Samples for GuestAgentsOperation List. */ -public final class SecuritySettingsListByClustersSamples { +public final class GuestAgentsOperationListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListSecuritySettingsByCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GuestAgent_List. + * json */ /** - * Sample code: List Security Settings. + * Sample code: GuestAgentListByVirtualMachineInstances. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.securitySettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); + 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); } } ``` -### Skus_Get +### HybridIdentityMetadata_Get ```java /** - * Samples for Skus Get. + * Samples for HybridIdentityMetadata Get. */ -public final class SkusGetSamples { +public final class HybridIdentityMetadataGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSku. - * json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetHybridIdentityMetadata.json */ /** - * Sample code: Get Sku. + * Sample code: GetHybridIdentityMetadata. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.skus() - .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", "sku1", null, + 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); } } ``` -### Skus_ListByOffer +### HybridIdentityMetadata_List ```java /** - * Samples for Skus ListByOffer. + * Samples for HybridIdentityMetadata List. */ -public final class SkusListByOfferSamples { +public final class HybridIdentityMetadataListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListSkusByOffer.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * HybridIdentityMetadata_List.json */ /** - * Sample code: List SKU resources by offer for the HCI Cluster. + * Sample code: HybridIdentityMetadataListByVirtualMachineInstances. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void - listSKUResourcesByOfferForTheHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.skus() - .listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + 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); } } ``` -### UpdateRuns_Delete +### LogicalNetworksOperation_CreateOrUpdate ```java +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; + /** - * Samples for UpdateRuns Delete. + * Samples for LogicalNetworksOperation CreateOrUpdate. */ -public final class UpdateRunsDeleteSamples { +public final class LogicalNetworksOperationCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutLogicalNetwork + * .json */ /** - * Sample code: Delete an Update. + * Sample code: PutLogicalNetwork. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateRuns() - .delete("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", - com.azure.core.util.Context.NONE); + public static void putLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations() + .define("test-lnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .create(); } } ``` -### UpdateRuns_Get +### LogicalNetworksOperation_Delete ```java /** - * Samples for UpdateRuns Get. + * Samples for LogicalNetworksOperation Delete. */ -public final class UpdateRunsGetSamples { +public final class LogicalNetworksOperationDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteLogicalNetwork.json */ /** - * Sample code: Get Update runs under cluster resource. + * Sample code: DeleteLogicalNetwork. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void - getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateRuns() - .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", - com.azure.core.util.Context.NONE); + public static void deleteLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().delete("test-rg", "test-lnet", com.azure.core.util.Context.NONE); } } ``` -### UpdateRuns_List +### LogicalNetworksOperation_GetByResourceGroup ```java /** - * Samples for UpdateRuns List. + * Samples for LogicalNetworksOperation GetByResourceGroup. */ -public final class UpdateRunsListSamples { +public final class LogicalNetworksOperationGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetLogicalNetwork + * .json */ /** - * Sample code: List Update runs under cluster resource. + * Sample code: GetLogicalNetwork. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void - listUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + public static void getLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-lnet", com.azure.core.util.Context.NONE); } } ``` -### UpdateRuns_Put +### LogicalNetworksOperation_List ```java -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import com.azure.resourcemanager.azurestackhci.models.UpdateRun; -import java.time.OffsetDateTime; -import java.util.Arrays; - /** - * Samples for UpdateRuns Put. + * Samples for LogicalNetworksOperation List. */ -public final class UpdateRunsPutSamples { +public final class LogicalNetworksOperationListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListLogicalNetworkBySubscription.json */ /** - * Sample code: Get Update runs under cluster resource. + * Sample code: ListLogicalNetworkBySubscription. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - UpdateRun resource = manager.updateRuns() - .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withNamePropertiesName("Unnamed step") - .withDescription("Update Azure Stack.") - .withErrorMessage("") - .withStatus("Success") - .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) - .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) - .withSteps(Arrays.asList(new Step().withName("PreUpdate Cloud") - .withDescription("Prepare for SSU update") - .withErrorMessage("") - .withStatus("Success") - .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) - .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) - .withSteps(Arrays.asList()))) - .apply(); + listLogicalNetworkBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().list(com.azure.core.util.Context.NONE); } } ``` -### UpdateSummariesOperation_Delete +### LogicalNetworksOperation_ListByResourceGroup ```java /** - * Samples for UpdateSummariesOperation Delete. + * Samples for LogicalNetworksOperation ListByResourceGroup. */ -public final class UpdateSummariesOperationDeleteSamples { +public final class LogicalNetworksOperationListByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteUpdateSummaries.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListLogicalNetworkByResourceGroup.json + */ + /** + * Sample code: ListLogicalNetworkByResourceGroup. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listLogicalNetworkByResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### LogicalNetworksOperation_Update + +```java +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworks; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogicalNetworksOperation Update. + */ +public final class LogicalNetworksOperationUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * UpdateLogicalNetwork.json + */ + /** + * Sample code: UpdateLogicalNetwork. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void updateLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + LogicalNetworks resource = manager.logicalNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-lnet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MarketplaceGalleryImagesOperation_CreateOrUpdate + +```java +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/2024-01-01/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( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-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(); + } +} +``` + +### MarketplaceGalleryImagesOperation_Delete + +```java +/** + * Samples for MarketplaceGalleryImagesOperation Delete. + */ +public final class MarketplaceGalleryImagesOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 +/** + * Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. + */ +public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/stable/2024-01-01/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); + } +} +``` + +### MarketplaceGalleryImagesOperation_ListByResourceGroup + +```java +/** + * Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. + */ +public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### MarketplaceGalleryImagesOperation_Update + +```java +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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkInterfacesOperation_CreateOrUpdate + +```java +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/stable/2024-01-01/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-lnet"))))) + .create(); + } +} +``` + +### NetworkInterfacesOperation_Delete + +```java +/** + * Samples for NetworkInterfacesOperation Delete. + */ +public final class NetworkInterfacesOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### NetworkInterfacesOperation_GetByResourceGroup + +```java +/** + * Samples for NetworkInterfacesOperation GetByResourceGroup. + */ +public final class NetworkInterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 + +```java +/** + * Samples for NetworkInterfacesOperation List. + */ +public final class NetworkInterfacesOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListNetworkInterfaceBySubscription.json + */ + /** + * Sample code: ListNetworkInterfaceBySubscription. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listNetworkInterfaceBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.networkInterfacesOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfacesOperation_ListByResourceGroup + +```java +/** + * Samples for NetworkInterfacesOperation ListByResourceGroup. + */ +public final class NetworkInterfacesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### NetworkInterfacesOperation_Update + +```java +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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Offers_Get + +```java +/** + * Samples for Offers Get. + */ +public final class OffersGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetOffer.json + */ + /** + * Sample code: Get Offer. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.offers() + .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Offers_ListByCluster + +```java +/** + * Samples for Offers ListByCluster. + */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListOffersByCluster.json + */ + /** + * Sample code: List Offer resources by HCI Cluster. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listOfferResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.offers().listByCluster("test-rg", "myCluster", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Offers_ListByPublisher + +```java +/** + * Samples for Offers ListByPublisher. + */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListOffersByPublisher.json + */ + /** + * Sample code: List Offer resources by publisher for the HCI Cluster. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void listOfferResourcesByPublisherForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-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(com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_Get + +```java +/** + * Samples for Publishers Get. + */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetPublisher.json + */ + /** + * Sample code: Get Publisher. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_ListByCluster + +```java +/** + * Samples for Publishers ListByCluster. + */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListPublishersByCluster.json + */ + /** + * Sample code: List Publisher resources by HCI Cluster. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listPublisherResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.publishers().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### SecuritySettings_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; + +/** + * Samples for SecuritySettings CreateOrUpdate. + */ +public final class SecuritySettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutSecuritySettings.json + */ + /** + * Sample code: Create Security Settings. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void createSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.securitySettings() + .define("default") + .withExistingCluster("test-rg", "myCluster") + .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) + .create(); + } +} +``` + +### SecuritySettings_Delete + +```java +/** + * Samples for SecuritySettings Delete. + */ +public final class SecuritySettingsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteSecuritySettings.json + */ + /** + * Sample code: Delete Security Settings. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.securitySettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### SecuritySettings_Get + +```java +/** + * Samples for SecuritySettings Get. + */ +public final class SecuritySettingsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetSecuritySettings.json + */ + /** + * Sample code: Get Security Settings. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.securitySettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### SecuritySettings_ListByClusters + +```java +/** + * Samples for SecuritySettings ListByClusters. + */ +public final class SecuritySettingsListByClustersSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListSecuritySettingsByCluster.json + */ + /** + * Sample code: List Security Settings. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void listSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.securitySettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Skus_Get + +```java +/** + * Samples for Skus Get. + */ +public final class SkusGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetSku.json + */ + /** + * Sample code: Get Sku. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getSku(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.skus() + .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", "sku1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Skus_ListByOffer + +```java +/** + * Samples for Skus ListByOffer. + */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListSkusByOffer. + * json + */ + /** + * Sample code: List SKU resources by offer for the HCI Cluster. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listSKUResourcesByOfferForTheHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.skus() + .listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageContainersOperation_CreateOrUpdate + +```java +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/stable/2024-01-01/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(); + } +} +``` + +### StorageContainersOperation_Delete + +```java +/** + * Samples for StorageContainersOperation Delete. + */ +public final class StorageContainersOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### StorageContainersOperation_GetByResourceGroup + +```java +/** + * Samples for StorageContainersOperation GetByResourceGroup. + */ +public final class StorageContainersOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### StorageContainersOperation_List + +```java +/** + * Samples for StorageContainersOperation List. + */ +public final class StorageContainersOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 + +```java +/** + * Samples for StorageContainersOperation ListByResourceGroup. + */ +public final class StorageContainersOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} +``` + +### StorageContainersOperation_Update + +```java +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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### UpdateRuns_Delete + +```java +/** + * Samples for UpdateRuns Delete. + */ +public final class UpdateRunsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdateRuns. + * json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateRuns() + .delete("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_Get + +```java +/** + * Samples for UpdateRuns Get. + */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdateRuns. + * json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateRuns() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_List + +```java +/** + * Samples for UpdateRuns List. + */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdateRuns. + * json + */ + /** + * Sample code: List Update runs under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_Put + +```java +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for UpdateRuns Put. + */ +public final class UpdateRunsPutSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdateRuns. + * json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + UpdateRun resource = manager.updateRuns() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withNamePropertiesName("Unnamed step") + .withDescription("Update Azure Stack.") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withSteps(Arrays.asList(new Step().withName("PreUpdate Cloud") + .withDescription("Prepare for SSU update") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withSteps(Arrays.asList()))) + .apply(); + } +} +``` + +### UpdateSummariesOperation_Delete + +```java +/** + * Samples for UpdateSummariesOperation Delete. + */ +public final class UpdateSummariesOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteUpdateSummaries.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Get + +```java +/** + * Samples for UpdateSummariesOperation Get. + */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_List + +```java +/** + * Samples for UpdateSummariesOperation List. + */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Put + +```java +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; + +/** + * Samples for UpdateSummariesOperation Put. + */ +public final class UpdateSummariesOperationPutSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutUpdateSummaries.json + */ + /** + * Sample code: Put Update summaries under cluster resource. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + putUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updateSummariesOperations() + .putWithResponse("testrg", "testcluster", + new UpdateSummariesInner().withOemFamily("DellEMC") + .withHardwareModel("PowerEdge R730xd") + .withCurrentVersion("4.2203.2.32") + .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) + .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Delete + +```java +/** + * Samples for Updates Delete. + */ +public final class UpdatesDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdates. + * json */ /** * Sample code: Delete an Update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Get + +```java +/** + * Samples for Updates Get. + */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdates.json + */ + /** + * Sample code: Get a specific update. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_List + +```java +/** + * Samples for Updates List. + */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Post + +```java +/** + * Samples for Updates Post. + */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PostUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Put + +```java +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Updates Put. + */ +public final class UpdatesPutSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdates.json + */ + /** + * Sample code: Put a specific update. + * + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + HciUpdate resource = manager.updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withDescription("AzS Update 4.2203.2.32") + .withState(State.INSTALLED) + .withPrerequisites(Arrays.asList(new UpdatePrerequisite().withUpdateType("update type") + .withVersion("prerequisite version") + .withPackageName("update package name"))) + .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") + .withPackageSizeInMb(18858.0F) + .withDisplayName("AzS Update - 4.2203.2.32") + .withVersion("4.2203.2.32") + .withPublisher("Microsoft") + .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") + .withAvailabilityType(AvailabilityType.LOCAL) + .withPackageType("Infrastructure") + .withAdditionalProperties("additional properties") + .withProgressPercentage(0.0F) + .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") + .apply(); } } ``` -### UpdateSummariesOperation_Get +### VirtualHardDisksOperation_CreateOrUpdate ```java +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; + /** - * Samples for UpdateSummariesOperation Get. + * Samples for VirtualHardDisksOperation CreateOrUpdate. */ -public final class UpdateSummariesOperationGetSamples { +public final class VirtualHardDisksOperationCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetUpdateSummaries.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutVirtualHardDisk.json */ /** - * Sample code: Get Update summaries under cluster resource. + * 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(); + } +} +``` + +### VirtualHardDisksOperation_Delete + +```java +/** + * Samples for VirtualHardDisksOperation Delete. + */ +public final class VirtualHardDisksOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteVirtualHardDisk.json + */ + /** + * Sample code: DeleteVirtualHardDisk. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.virtualHardDisksOperations().delete("test-rg", "test-vhd", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHardDisksOperation_GetByResourceGroup + +```java +/** + * Samples for VirtualHardDisksOperation GetByResourceGroup. + */ +public final class VirtualHardDisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 + +```java +/** + * Samples for VirtualHardDisksOperation List. + */ +public final class VirtualHardDisksOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListVirtualHardDiskBySubscription.json + */ + /** + * Sample code: ListVirtualHardDiskBySubscription. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); + listVirtualHardDiskBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.virtualHardDisksOperations().list(com.azure.core.util.Context.NONE); } } ``` -### UpdateSummariesOperation_List +### VirtualHardDisksOperation_ListByResourceGroup ```java /** - * Samples for UpdateSummariesOperation List. + * Samples for VirtualHardDisksOperation ListByResourceGroup. */ -public final class UpdateSummariesOperationListSamples { +public final class VirtualHardDisksOperationListByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListUpdateSummaries.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListVirtualHardDiskByResourceGroup.json */ /** - * Sample code: Get Update summaries under cluster resource. + * Sample code: ListVirtualHardDiskByResourceGroup. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + listVirtualHardDiskByResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.virtualHardDisksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### UpdateSummariesOperation_Put +### VirtualHardDisksOperation_Update ```java -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; -import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; +import java.util.HashMap; +import java.util.Map; /** - * Samples for UpdateSummariesOperation Put. + * Samples for VirtualHardDisksOperation Update. */ -public final class UpdateSummariesOperationPutSamples { +public final class VirtualHardDisksOperationUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutUpdateSummaries.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * UpdateVirtualHardDisk.json */ /** - * Sample code: Put Update summaries under cluster resource. + * 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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### 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/stable/2024-01-01/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/stable/2024-01-01/examples/ + * PutVirtualMachineInstanceWithOsDisk.json + */ + /** + * Sample code: PutVirtualMachineInstanceWithOsDisk. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - putUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updateSummariesOperations() - .putWithResponse("testrg", "testcluster", - new UpdateSummariesInner().withOemFamily("DellEMC") - .withHardwareModel("PowerEdge R730xd") - .withCurrentVersion("4.2203.2.32") - .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) - .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) - .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + 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/stable/2024-01-01/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/stable/2024-01-01/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); } } ``` -### Updates_Delete +### VirtualMachineInstances_Delete ```java /** - * Samples for Updates Delete. + * Samples for VirtualMachineInstances Delete. */ -public final class UpdatesDeleteSamples { +public final class VirtualMachineInstancesDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteVirtualMachineInstance.json */ /** - * Sample code: Delete an Update. + * Sample code: DeleteVirtualMachine. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + 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", + com.azure.core.util.Context.NONE); } } ``` -### Updates_Get +### VirtualMachineInstances_Get ```java /** - * Samples for Updates Get. + * Samples for VirtualMachineInstances Get. */ -public final class UpdatesGetSamples { +public final class VirtualMachineInstancesGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetVirtualMachineInstance.json */ /** - * Sample code: Get a specific update. + * Sample code: GetVirtualMachineInstance. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updates() - .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + 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); } } ``` -### Updates_List +### VirtualMachineInstances_List ```java /** - * Samples for Updates List. + * Samples for VirtualMachineInstances List. */ -public final class UpdatesListSamples { +public final class VirtualMachineInstancesListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListVirtualMachineInstances.json */ /** - * Sample code: List available updates. + * Sample code: ListVirtualMachineInstances. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + 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); } } ``` -### Updates_Post +### VirtualMachineInstances_Restart ```java /** - * Samples for Updates Post. + * Samples for VirtualMachineInstances Restart. */ -public final class UpdatesPostSamples { +public final class VirtualMachineInstancesRestartSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PostUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * RestartVirtualMachineInstance.json */ /** - * Sample code: List available updates. + * Sample code: RestartVirtualMachine. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + 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/default", + com.azure.core.util.Context.NONE); } } ``` -### Updates_Put +### VirtualMachineInstances_Start ```java -import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; -import com.azure.resourcemanager.azurestackhci.models.HciUpdate; -import com.azure.resourcemanager.azurestackhci.models.State; -import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; -import java.time.OffsetDateTime; -import java.util.Arrays; +/** + * Samples for VirtualMachineInstances Start. + */ +public final class VirtualMachineInstancesStartSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/default", + com.azure.core.util.Context.NONE); + } +} +``` +### VirtualMachineInstances_Stop + +```java /** - * Samples for Updates Put. + * Samples for VirtualMachineInstances Stop. */ -public final class UpdatesPutSamples { +public final class VirtualMachineInstancesStopSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * StopVirtualMachineInstance.json */ /** - * Sample code: Put a specific update. + * Sample code: StopVirtualMachine. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - HciUpdate resource = manager.updates() - .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) - .withDescription("AzS Update 4.2203.2.32") - .withState(State.INSTALLED) - .withPrerequisites(Arrays.asList(new UpdatePrerequisite().withUpdateType("update type") - .withVersion("prerequisite version") - .withPackageName("update package name"))) - .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") - .withPackageSizeInMb(18858.0F) - .withDisplayName("AzS Update - 4.2203.2.32") - .withVersion("4.2203.2.32") - .withPublisher("Microsoft") - .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") - .withAvailabilityType(AvailabilityType.LOCAL) - .withPackageType("Infrastructure") - .withAdditionalProperties("additional properties") - .withProgressPercentage(0.0F) - .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") - .apply(); + 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/default", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineInstances_Update + +```java +import com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdate; +import com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdateDataDisksItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateProperties; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; +import java.util.Arrays; + +/** + * Samples for VirtualMachineInstances Update. + */ +public final class VirtualMachineInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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().withStorageProfile(new StorageProfileUpdate() + .withDataDisks(Arrays.asList(new StorageProfileUpdateDataDisksItem().withId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"))))), + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index 488cce53b45b..53a292c26e94 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -17,8 +17,8 @@ 1.0.0-beta.6 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-2024-04. + 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-2024-01. https://github.com/Azure/azure-sdk-for-java @@ -46,13 +46,9 @@ 0 0 true + false - - com.azure - azure-json - 1.3.0 - com.azure azure-core @@ -63,6 +59,11 @@ azure-core-management 1.15.6 + + com.azure + azure-json + 1.3.0 + com.azure azure-core-test 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 similarity index 66% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzurestackhciManager.java index 89f4053a15c9..2078c05fd5df 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 @@ -11,15 +11,15 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -30,27 +30,47 @@ import com.azure.resourcemanager.azurestackhci.implementation.DeploymentSettingsImpl; import com.azure.resourcemanager.azurestackhci.implementation.EdgeDevicesImpl; import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; +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.LogicalNetworksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.MarketplaceGalleryImagesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.NetworkInterfacesOperationsImpl; import com.azure.resourcemanager.azurestackhci.implementation.OffersImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; import com.azure.resourcemanager.azurestackhci.implementation.PublishersImpl; import com.azure.resourcemanager.azurestackhci.implementation.SecuritySettingsImpl; import com.azure.resourcemanager.azurestackhci.implementation.SkusImpl; +import com.azure.resourcemanager.azurestackhci.implementation.StorageContainersOperationsImpl; import com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsImpl; -import com.azure.resourcemanager.azurestackhci.implementation.UpdatesImpl; import com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdatesImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualHardDisksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualMachineInstancesImpl; import com.azure.resourcemanager.azurestackhci.models.ArcSettings; import com.azure.resourcemanager.azurestackhci.models.Clusters; import com.azure.resourcemanager.azurestackhci.models.DeploymentSettings; import com.azure.resourcemanager.azurestackhci.models.EdgeDevices; import com.azure.resourcemanager.azurestackhci.models.Extensions; +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.LogicalNetworksOperations; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesOperations; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesOperations; import com.azure.resourcemanager.azurestackhci.models.Offers; import com.azure.resourcemanager.azurestackhci.models.Operations; import com.azure.resourcemanager.azurestackhci.models.Publishers; import com.azure.resourcemanager.azurestackhci.models.SecuritySettings; import com.azure.resourcemanager.azurestackhci.models.Skus; +import com.azure.resourcemanager.azurestackhci.models.StorageContainersOperations; import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; -import com.azure.resourcemanager.azurestackhci.models.Updates; import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; +import com.azure.resourcemanager.azurestackhci.models.Updates; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstances; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -59,10 +79,10 @@ import java.util.stream.Collectors; /** - * Entry point to AzureStackHciManager. + * Entry point to AzurestackhciManager. * Azure Stack HCI management service. */ -public final class AzureStackHciManager { +public final class AzurestackhciManager { private ArcSettings arcSettings; private Clusters clusters; @@ -73,6 +93,14 @@ public final class AzureStackHciManager { private Extensions extensions; + private GalleryImagesOperations galleryImagesOperations; + + private LogicalNetworksOperations logicalNetworksOperations; + + private MarketplaceGalleryImagesOperations marketplaceGalleryImagesOperations; + + private NetworkInterfacesOperations networkInterfacesOperations; + private Offers offers; private Operations operations; @@ -83,15 +111,27 @@ public final class AzureStackHciManager { private Skus skus; + private StorageContainersOperations storageContainersOperations; + private UpdateRuns updateRuns; private UpdateSummariesOperations updateSummariesOperations; private Updates updates; + private VirtualHardDisksOperations virtualHardDisksOperations; + + private VirtualMachineInstances virtualMachineInstances; + + private HybridIdentityMetadatas hybridIdentityMetadatas; + + private GuestAgents guestAgents; + + private GuestAgentsOperations guestAgentsOperations; + private final AzureStackHciClient clientObject; - private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private AzurestackhciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new AzureStackHciClientBuilder().pipeline(httpPipeline) @@ -102,38 +142,38 @@ private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Du } /** - * Creates an instance of AzureStackHci service API entry point. + * Creates an instance of azurestackhci service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureStackHci service API instance. + * @return the azurestackhci service API instance. */ - public static AzureStackHciManager authenticate(TokenCredential credential, AzureProfile profile) { + public static AzurestackhciManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Creates an instance of AzureStackHci service API entry point. + * Creates an instance of azurestackhci service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the AzureStackHci service API instance. + * @return the azurestackhci service API instance. */ - public static AzureStackHciManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + public static AzurestackhciManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AzureStackHciManager(httpPipeline, profile, null); + return new AzurestackhciManager(httpPipeline, profile, null); } /** - * Gets a Configurable instance that can be used to create AzureStackHciManager with optional configuration. + * Gets a Configurable instance that can be used to create AzurestackhciManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new AzureStackHciManager.Configurable(); + return new AzurestackhciManager.Configurable(); } /** @@ -238,13 +278,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of AzureStackHci service API entry point. + * Creates an instance of azurestackhci service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureStackHci service API instance. + * @return the azurestackhci service API instance. */ - public AzureStackHciManager authenticate(TokenCredential credential, AzureProfile profile) { + public AzurestackhciManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -253,7 +293,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.5"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -286,7 +326,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); @@ -295,7 +335,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new AzureStackHciManager(httpPipeline, profile, defaultPollInterval); + return new AzurestackhciManager(httpPipeline, profile, defaultPollInterval); } } @@ -336,7 +376,7 @@ public DeploymentSettings deploymentSettings() { } /** - * Gets the resource collection API of EdgeDevices. + * Gets the resource collection API of EdgeDevices. It manages EdgeDevice. * * @return Resource collection API of EdgeDevices. */ @@ -359,6 +399,58 @@ public Extensions extensions() { return extensions; } + /** + * 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 LogicalNetworksOperations. It manages LogicalNetworks. + * + * @return Resource collection API of LogicalNetworksOperations. + */ + public LogicalNetworksOperations logicalNetworksOperations() { + if (this.logicalNetworksOperations == null) { + this.logicalNetworksOperations + = new LogicalNetworksOperationsImpl(clientObject.getLogicalNetworksOperations(), this); + } + return logicalNetworksOperations; + } + + /** + * 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 Offers. * @@ -419,6 +511,19 @@ public Skus skus() { return skus; } + /** + * 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 UpdateRuns. It manages UpdateRun. * @@ -456,6 +561,69 @@ public Updates updates() { return updates; } + /** + * 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 HybridIdentityMetadatas. + */ + public HybridIdentityMetadatas hybridIdentityMetadatas() { + if (this.hybridIdentityMetadatas == null) { + this.hybridIdentityMetadatas + = new HybridIdentityMetadatasImpl(clientObject.getHybridIdentityMetadatas(), this); + } + return hybridIdentityMetadatas; + } + + /** + * Gets the resource collection API of GuestAgents. + * + * @return Resource collection API of GuestAgents. + */ + public GuestAgents guestAgents() { + if (this.guestAgents == null) { + this.guestAgents = new GuestAgentsImpl(clientObject.getGuestAgents(), this); + } + return guestAgents; + } + + /** + * Gets the resource collection API of GuestAgentsOperations. + * + * @return Resource collection API of GuestAgentsOperations. + */ + public GuestAgentsOperations guestAgentsOperations() { + if (this.guestAgentsOperations == null) { + this.guestAgentsOperations = new GuestAgentsOperationsImpl(clientObject.getGuestAgentsOperations(), this); + } + return guestAgentsOperations; + } + /** * Gets wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. 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 60bae890277c..cbc3ac09a81a 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 @@ -12,7 +12,7 @@ */ public interface AzureStackHciClient { /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -81,6 +81,34 @@ public interface AzureStackHciClient { */ ExtensionsClient getExtensions(); + /** + * Gets the GalleryImagesOperationsClient object to access its operations. + * + * @return the GalleryImagesOperationsClient object. + */ + GalleryImagesOperationsClient getGalleryImagesOperations(); + + /** + * Gets the LogicalNetworksOperationsClient object to access its operations. + * + * @return the LogicalNetworksOperationsClient object. + */ + LogicalNetworksOperationsClient getLogicalNetworksOperations(); + + /** + * Gets the MarketplaceGalleryImagesOperationsClient object to access its operations. + * + * @return the MarketplaceGalleryImagesOperationsClient object. + */ + MarketplaceGalleryImagesOperationsClient getMarketplaceGalleryImagesOperations(); + + /** + * Gets the NetworkInterfacesOperationsClient object to access its operations. + * + * @return the NetworkInterfacesOperationsClient object. + */ + NetworkInterfacesOperationsClient getNetworkInterfacesOperations(); + /** * Gets the OffersClient object to access its operations. * @@ -116,6 +144,13 @@ public interface AzureStackHciClient { */ SkusClient getSkus(); + /** + * Gets the StorageContainersOperationsClient object to access its operations. + * + * @return the StorageContainersOperationsClient object. + */ + StorageContainersOperationsClient getStorageContainersOperations(); + /** * Gets the UpdateRunsClient object to access its operations. * @@ -136,4 +171,39 @@ public interface AzureStackHciClient { * @return the UpdatesClient object. */ UpdatesClient getUpdates(); + + /** + * 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(); } 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/ClustersClient.java index 2dcf0710ebb4..98a1661602d8 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/ClustersClient.java @@ -14,8 +14,6 @@ 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.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; @@ -387,128 +385,4 @@ ClusterInner extendSoftwareAssuranceBenefit(String resourceGroupName, String clu @ServiceMethod(returns = ReturnType.SINGLE) ClusterInner extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterInner> beginTriggerLogCollection(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest); - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterInner> beginTriggerLogCollection(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest, Context context); - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - ClusterInner triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest); - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest, Context context); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterInner> beginConfigureRemoteSupport(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterInner> beginConfigureRemoteSupport(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest, Context context); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - ClusterInner configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest, Context context); } 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 000000000000..f43755f24910 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryImagesOperationsClient.java @@ -0,0 +1,279 @@ +// Copyright (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 galleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 galleryImages parameter. + * @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 galleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 galleryImages parameter. + * @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 galleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 galleryImages parameter. + * @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 galleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 galleryImages parameter. + * @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 000000000000..71fff973f731 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsClient.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.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 000000000000..85e748c6c412 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GuestAgentsOperationsClient.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.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 000000000000..4ed15fa023b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/HybridIdentityMetadatasClient.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; + +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/LogicalNetworksOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/LogicalNetworksOperationsClient.java new file mode 100644 index 000000000000..8a6626c2c5ef --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/LogicalNetworksOperationsClient.java @@ -0,0 +1,280 @@ +// Copyright (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.LogicalNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksUpdateRequest; + +/** + * An instance of this class provides access to all the operations defined in LogicalNetworksOperationsClient. + */ +public interface LogicalNetworksOperationsClient { + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String logicalNetworkName, + Context context); + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworksInner getByResourceGroup(String resourceGroupName, String logicalNetworkName); + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogicalNetworksInner> beginCreateOrUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksInner logicalNetworks); + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogicalNetworksInner> beginCreateOrUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksInner logicalNetworks, Context context); + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworksInner createOrUpdate(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks); + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworksInner createOrUpdate(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks, Context context); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName, + Context context); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName, Context context); + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogicalNetworksInner> beginUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks); + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogicalNetworksInner> beginUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks, Context context); + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworksInner update(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks); + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks parameter. + * @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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworksInner update(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks, Context context); + + /** + * Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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/MarketplaceGalleryImagesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/MarketplaceGalleryImagesOperationsClient.java new file mode 100644 index 000000000000..d3f1b3a576cf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/MarketplaceGalleryImagesOperationsClient.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.MarketplaceGalleryImagesInner; +import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest; + +/** + * An instance of this class provides access to all the operations defined in MarketplaceGalleryImagesOperationsClient. + */ +public interface MarketplaceGalleryImagesOperationsClient { + /** + * 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}. + */ + @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); + + /** + * 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 marketplaceGalleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 marketplaceGalleryImages parameter. + * @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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, Context context); + + /** + * 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 marketplaceGalleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + MarketplaceGalleryImagesInner createOrUpdate(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 marketplaceGalleryImages parameter. + * @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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceGalleryImagesInner createOrUpdate(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, Context context); + + /** + * 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String marketplaceGalleryImageName, + Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String marketplaceGalleryImageName, Context context); + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdate( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages); + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages parameter. + * @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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context); + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + MarketplaceGalleryImagesInner update(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages); + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages parameter. + * @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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceGalleryImagesInner update(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java new file mode 100644 index 000000000000..f7e5d94c48b6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkInterfacesOperationsClient.java @@ -0,0 +1,280 @@ +// Copyright (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.NetworkInterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfacesOperationsClient. + */ +public interface NetworkInterfacesOperationsClient { + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfacesInner getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * 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 networkInterfaces parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesInner networkInterfaces); + + /** + * 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 networkInterfaces parameter. + * @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.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesInner networkInterfaces, Context 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 networkInterfaces parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + NetworkInterfacesInner createOrUpdate(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesInner networkInterfaces); + + /** + * 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 networkInterfaces parameter. + * @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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfacesInner createOrUpdate(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, Context 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 com.azure.core.management.exception.ManagementException 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 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName, + Context 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 com.azure.core.management.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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkInterfaceName, Context 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 networkInterfaces parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, NetworkInterfacesInner> beginUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces); + + /** + * 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 networkInterfaces parameter. + * @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.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfacesInner> beginUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces, Context 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 networkInterfaces parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + NetworkInterfacesInner update(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces); + + /** + * 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 networkInterfaces parameter. + * @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 network interface resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfacesInner update(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(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 000000000000..3726f688314b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StorageContainersOperationsClient.java @@ -0,0 +1,280 @@ +// Copyright (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 storageContainers parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storageContainers parameter. + * @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 storageContainers parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storageContainers parameter. + * @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 storageContainers parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storageContainers parameter. + * @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 storageContainers parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storageContainers parameter. + * @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/VirtualHardDisksOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualHardDisksOperationsClient.java new file mode 100644 index 000000000000..5a466690b02e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualHardDisksOperationsClient.java @@ -0,0 +1,280 @@ +// Copyright (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.VirtualHardDisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest; + +/** + * An instance of this class provides access to all the operations defined in VirtualHardDisksOperationsClient. + */ +public interface VirtualHardDisksOperationsClient { + /** + * 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 a virtual hard disk along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualHardDiskName, + 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 com.azure.core.management.exception.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) + VirtualHardDisksInner getByResourceGroup(String resourceGroupName, String virtualHardDiskName); + + /** + * 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 virtualHardDisks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks); + + /** + * 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 virtualHardDisks parameter. + * @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 hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHardDisksInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context 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 virtualHardDisks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + VirtualHardDisksInner createOrUpdate(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksInner virtualHardDisks); + + /** + * 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 virtualHardDisks parameter. + * @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) + VirtualHardDisksInner createOrUpdate(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksInner virtualHardDisks, Context 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 com.azure.core.management.exception.ManagementException 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 virtualHardDiskName); + + /** + * 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 com.azure.core.management.exception.ManagementException 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 virtualHardDiskName, + Context 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 com.azure.core.management.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 virtualHardDiskName); + + /** + * 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 com.azure.core.management.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 virtualHardDiskName, Context 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 virtualHardDisks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, VirtualHardDisksInner> beginUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks); + + /** + * 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 virtualHardDisks parameter. + * @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 hard disk resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHardDisksInner> beginUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks, Context 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 virtualHardDisks parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + VirtualHardDisksInner update(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks); + + /** + * 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 virtualHardDisks parameter. + * @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) + VirtualHardDisksInner update(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, Context 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 com.azure.core.management.exception.ManagementException 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 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 com.azure.core.management.exception.ManagementException 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 hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @throws com.azure.core.management.exception.ManagementException 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 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 com.azure.core.management.exception.ManagementException 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/VirtualMachineInstancesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualMachineInstancesClient.java new file mode 100644 index 000000000000..5006110e708a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualMachineInstancesClient.java @@ -0,0 +1,417 @@ +// Copyright (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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java index 15a62cf20d63..8be933c2ef01 100644 --- 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 @@ -33,9 +33,9 @@ public final class ArcSettingInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -43,9 +43,9 @@ public final class ArcSettingInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ArcSettingInner class. @@ -72,13 +72,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -92,13 +92,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** 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 index 1723360506c4..90402404b61d 100644 --- 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 @@ -14,10 +14,8 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ConnectivityStatus; import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionProperties; import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; @@ -47,9 +45,9 @@ public final class ClusterInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -57,9 +55,9 @@ public final class ClusterInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ClusterInner class. @@ -95,13 +93,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -115,13 +113,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -390,52 +388,6 @@ public ClusterInner withSoftwareAssuranceProperties(SoftwareAssuranceProperties return this; } - /** - * Get the logCollectionProperties property: Log Collection properties of the cluster. - * - * @return the logCollectionProperties value. - */ - public LogCollectionProperties logCollectionProperties() { - return this.innerProperties() == null ? null : this.innerProperties().logCollectionProperties(); - } - - /** - * Set the logCollectionProperties property: Log Collection properties of the cluster. - * - * @param logCollectionProperties the logCollectionProperties value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withLogCollectionProperties(LogCollectionProperties logCollectionProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withLogCollectionProperties(logCollectionProperties); - return this; - } - - /** - * Get the remoteSupportProperties property: RemoteSupport properties of the cluster. - * - * @return the remoteSupportProperties value. - */ - public RemoteSupportProperties remoteSupportProperties() { - return this.innerProperties() == null ? null : this.innerProperties().remoteSupportProperties(); - } - - /** - * Set the remoteSupportProperties property: RemoteSupport properties of the cluster. - * - * @param remoteSupportProperties the remoteSupportProperties value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withRemoteSupportProperties(RemoteSupportProperties remoteSupportProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withRemoteSupportProperties(remoteSupportProperties); - return this; - } - /** * Get the desiredProperties property: Desired properties of the cluster. * 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 index 07d16fd324e3..5617f545d6d5 100644 --- 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 @@ -14,9 +14,7 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ConnectivityStatus; import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionProperties; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import java.io.IOException; @@ -77,16 +75,6 @@ public final class ClusterProperties implements JsonSerializable { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("HCI".equals(discriminatorValue)) { - return HciEdgeDevice.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static EdgeDeviceInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { EdgeDeviceInner deserializedEdgeDeviceInner = new EdgeDeviceInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -174,8 +187,8 @@ static EdgeDeviceInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws deserializedEdgeDeviceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedEdgeDeviceInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedEdgeDeviceInner.kind = DeviceKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEdgeDeviceInner.innerProperties = EdgeDeviceProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedEdgeDeviceInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDeviceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.java similarity index 87% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDeviceProperties.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.java index cac657831a4b..6dc2746bd9b1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDeviceProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.azurestackhci.models; +package com.azure.resourcemanager.azurestackhci.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import java.io.IOException; /** * Edge Device properties. */ @Fluent -public class EdgeDeviceProperties implements JsonSerializable { +public final class EdgeDeviceProperties implements JsonSerializable { /* * Device Configuration */ @@ -67,7 +69,7 @@ public ProvisioningState provisioningState() { * @param provisioningState the provisioningState value to set. * @return the EdgeDeviceProperties object itself. */ - EdgeDeviceProperties withProvisioningState(ProvisioningState provisioningState) { + public EdgeDeviceProperties withProvisioningState(ProvisioningState provisioningState) { this.provisioningState = provisioningState; return this; } @@ -90,6 +92,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("deviceConfiguration", this.deviceConfiguration); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); return jsonWriter.writeEndObject(); } 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 index e942d3a82fe7..730959ed2066 100644 --- 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 @@ -33,9 +33,9 @@ public final class ExtensionInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -43,9 +43,9 @@ public final class ExtensionInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ExtensionInner class. @@ -72,13 +72,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -92,13 +92,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** 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 000000000000..ceada5663ff1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageProperties.java @@ -0,0 +1,326 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties under the gallery image resource. + */ +@Fluent +public final class GalleryImageProperties implements JsonSerializable { + /* + * Storage ContainerID of the storage container to be used for gallery image + */ + private String containerId; + + /* + * location of the image the gallery image should be created from + */ + private String imagePath; + + /* + * Operating system type that the gallery image uses [Windows, Linux] + */ + private OperatingSystemTypes osType; + + /* + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] + */ + private CloudInitDataSource cloudInitDataSource; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + private HyperVGeneration hyperVGeneration; + + /* + * This is the gallery image definition identifier. + */ + private GalleryImageIdentifier identifier; + + /* + * Specifies information about the gallery image version that you want to create or update. + */ + private GalleryImageVersion version; + + /* + * Provisioning state of the gallery image. + */ + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of gallery images + */ + 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.atError() + .log(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); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("containerId", this.containerId); + jsonWriter.writeStringField("imagePath", this.imagePath); + jsonWriter.writeStringField("cloudInitDataSource", + this.cloudInitDataSource == null ? null : this.cloudInitDataSource.toString()); + jsonWriter.writeStringField("hyperVGeneration", + this.hyperVGeneration == null ? null : this.hyperVGeneration.toString()); + jsonWriter.writeJsonField("identifier", this.identifier); + jsonWriter.writeJsonField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GalleryImageProperties. + */ + public static GalleryImageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageProperties deserializedGalleryImageProperties = new GalleryImageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedGalleryImageProperties.osType = OperatingSystemTypes.fromString(reader.getString()); + } else if ("containerId".equals(fieldName)) { + deserializedGalleryImageProperties.containerId = reader.getString(); + } else if ("imagePath".equals(fieldName)) { + deserializedGalleryImageProperties.imagePath = reader.getString(); + } else if ("cloudInitDataSource".equals(fieldName)) { + deserializedGalleryImageProperties.cloudInitDataSource + = CloudInitDataSource.fromString(reader.getString()); + } else if ("hyperVGeneration".equals(fieldName)) { + deserializedGalleryImageProperties.hyperVGeneration + = HyperVGeneration.fromString(reader.getString()); + } else if ("identifier".equals(fieldName)) { + deserializedGalleryImageProperties.identifier = GalleryImageIdentifier.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedGalleryImageProperties.version = GalleryImageVersion.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedGalleryImageProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedGalleryImageProperties.status = GalleryImageStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageProperties; + }); + } +} 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 000000000000..a22bd19d6190 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImageVersionProperties.java @@ -0,0 +1,107 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile; +import java.io.IOException; + +/** + * Describes the properties of a gallery image version. + */ +@Fluent +public final class GalleryImageVersionProperties implements JsonSerializable { + /* + * This is the storage profile of a Gallery Image Version. + */ + 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.atError() + .log(new IllegalArgumentException( + "Missing required property storageProfile in model GalleryImageVersionProperties")); + } else { + storageProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageVersionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageVersionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GalleryImageVersionProperties. + */ + public static GalleryImageVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageVersionProperties deserializedGalleryImageVersionProperties + = new GalleryImageVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageProfile".equals(fieldName)) { + deserializedGalleryImageVersionProperties.storageProfile + = GalleryImageVersionStorageProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageVersionProperties; + }); + } +} 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 000000000000..9f6711ed93b6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryImagesInner.java @@ -0,0 +1,402 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * The gallery images resource definition. + */ +@Fluent +public final class GalleryImagesInner extends Resource { + /* + * Properties under the gallery image resource + */ + private GalleryImageProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImagesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImagesInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GalleryImagesInner. + */ + public static GalleryImagesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImagesInner deserializedGalleryImagesInner = new GalleryImagesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGalleryImagesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGalleryImagesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGalleryImagesInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGalleryImagesInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryImagesInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGalleryImagesInner.innerProperties = GalleryImageProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedGalleryImagesInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGalleryImagesInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImagesInner; + }); + } +} 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 000000000000..619826a764de --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentInner.java @@ -0,0 +1,227 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; +import java.io.IOException; + +/** + * Defines the GuestAgent. + */ +@Fluent +public final class GuestAgentInner extends ProxyResource { + /* + * Resource properties. + */ + private GuestAgentProperties innerProperties = new GuestAgentProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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 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.atError() + .log( + new IllegalArgumentException("Missing required property innerProperties in model GuestAgentInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuestAgentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuestAgentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GuestAgentInner. + */ + public static GuestAgentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuestAgentInner deserializedGuestAgentInner = new GuestAgentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGuestAgentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGuestAgentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGuestAgentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGuestAgentInner.innerProperties = GuestAgentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGuestAgentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGuestAgentInner; + }); + } +} 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 000000000000..c3018aa95d92 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GuestAgentProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.GuestCredential; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; +import java.io.IOException; + +/** + * Defines the resource properties. + */ +@Fluent +public final class GuestAgentProperties implements JsonSerializable { + /* + * Username / Password Credentials to provision guest agent. + */ + private GuestCredential credentials; + + /* + * The guest agent provisioning action. + */ + private ProvisioningAction provisioningAction; + + /* + * The guest agent status. + */ + private String status; + + /* + * The provisioning state. + */ + 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 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", this.credentials); + jsonWriter.writeStringField("provisioningAction", + this.provisioningAction == null ? null : this.provisioningAction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuestAgentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuestAgentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GuestAgentProperties. + */ + public static GuestAgentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuestAgentProperties deserializedGuestAgentProperties = new GuestAgentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedGuestAgentProperties.credentials = GuestCredential.fromJson(reader); + } else if ("provisioningAction".equals(fieldName)) { + deserializedGuestAgentProperties.provisioningAction + = ProvisioningAction.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedGuestAgentProperties.status = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedGuestAgentProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGuestAgentProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java index c666b15899a7..8065fe26a1ba 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java @@ -43,9 +43,9 @@ public final class HciUpdateInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -53,9 +53,9 @@ public final class HciUpdateInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of HciUpdateInner class. @@ -102,13 +102,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -122,13 +122,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -186,29 +186,6 @@ public HciUpdateInner withDescription(String description) { return this; } - /** - * Get the minSbeVersionRequired property: Minimum Sbe Version of the update. - * - * @return the minSbeVersionRequired value. - */ - public String minSbeVersionRequired() { - return this.innerProperties() == null ? null : this.innerProperties().minSbeVersionRequired(); - } - - /** - * Set the minSbeVersionRequired property: Minimum Sbe Version of the update. - * - * @param minSbeVersionRequired the minSbeVersionRequired value to set. - * @return the HciUpdateInner object itself. - */ - public HciUpdateInner withMinSbeVersionRequired(String minSbeVersionRequired) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateProperties(); - } - this.innerProperties().withMinSbeVersionRequired(minSbeVersionRequired); - return this; - } - /** * Get the state property: State of the update as it relates to this stamp. * 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 000000000000..01c72d674e1f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataInner.java @@ -0,0 +1,227 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import java.io.IOException; + +/** + * Defines the HybridIdentityMetadata. + */ +@Fluent +public final class HybridIdentityMetadataInner extends ProxyResource { + /* + * Resource properties. + */ + private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model HybridIdentityMetadataInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HybridIdentityMetadataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HybridIdentityMetadataInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HybridIdentityMetadataInner. + */ + public static HybridIdentityMetadataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HybridIdentityMetadataInner deserializedHybridIdentityMetadataInner = new HybridIdentityMetadataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHybridIdentityMetadataInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHybridIdentityMetadataInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHybridIdentityMetadataInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHybridIdentityMetadataInner.innerProperties + = HybridIdentityMetadataProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHybridIdentityMetadataInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHybridIdentityMetadataInner; + }); + } +} 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 000000000000..3b1900099357 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HybridIdentityMetadataProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.Identity; +import java.io.IOException; + +/** + * Defines the resource properties. + */ +@Fluent +public final class HybridIdentityMetadataProperties implements JsonSerializable { + /* + * The unique identifier for the resource. + */ + private String resourceUid; + + /* + * The Public Key. + */ + private String publicKey; + + /* + * Identity for the resource. + */ + private Identity identity; + + /* + * The provisioning state. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceUid", this.resourceUid); + jsonWriter.writeStringField("publicKey", this.publicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HybridIdentityMetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HybridIdentityMetadataProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HybridIdentityMetadataProperties. + */ + public static HybridIdentityMetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HybridIdentityMetadataProperties deserializedHybridIdentityMetadataProperties + = new HybridIdentityMetadataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceUid".equals(fieldName)) { + deserializedHybridIdentityMetadataProperties.resourceUid = reader.getString(); + } else if ("publicKey".equals(fieldName)) { + deserializedHybridIdentityMetadataProperties.publicKey = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedHybridIdentityMetadataProperties.identity = Identity.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedHybridIdentityMetadataProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHybridIdentityMetadataProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworkProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworkProperties.java new file mode 100644 index 000000000000..5b55ca8c4e13 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworkProperties.java @@ -0,0 +1,201 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkStatus; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.Subnet; +import java.io.IOException; +import java.util.List; + +/** + * Properties under the logical network resource. + */ +@Fluent +public final class LogicalNetworkProperties implements JsonSerializable { + /* + * DhcpOptions contains an array of DNS servers available to VMs deployed in the logical network. Standard DHCP + * option for a subnet overrides logical network DHCP options. + */ + private LogicalNetworkPropertiesDhcpOptions dhcpOptions; + + /* + * Subnet - list of subnets under the logical network + */ + private List subnets; + + /* + * Provisioning state of the logical network. + */ + private ProvisioningStateEnum provisioningState; + + /* + * name of the network switch to be used for VMs + */ + private String vmSwitchName; + + /* + * The observed state of logical networks + */ + private LogicalNetworkStatus status; + + /** + * Creates an instance of LogicalNetworkProperties class. + */ + public LogicalNetworkProperties() { + } + + /** + * Get the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + * + * @return the dhcpOptions value. + */ + public LogicalNetworkPropertiesDhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs deployed in the + * logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + * + * @param dhcpOptions the dhcpOptions value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withDhcpOptions(LogicalNetworkPropertiesDhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the logical network. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: Subnet - list of subnets under the logical network. + * + * @param subnets the subnets value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the logical 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 LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withVmSwitchName(String vmSwitchName) { + this.vmSwitchName = vmSwitchName; + return this; + } + + /** + * Get the status property: The observed state of logical networks. + * + * @return the status value. + */ + public LogicalNetworkStatus 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dhcpOptions", this.dhcpOptions); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vmSwitchName", this.vmSwitchName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworkProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworkProperties. + */ + public static LogicalNetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworkProperties deserializedLogicalNetworkProperties = new LogicalNetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dhcpOptions".equals(fieldName)) { + deserializedLogicalNetworkProperties.dhcpOptions + = LogicalNetworkPropertiesDhcpOptions.fromJson(reader); + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> Subnet.fromJson(reader1)); + deserializedLogicalNetworkProperties.subnets = subnets; + } else if ("provisioningState".equals(fieldName)) { + deserializedLogicalNetworkProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("vmSwitchName".equals(fieldName)) { + deserializedLogicalNetworkProperties.vmSwitchName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedLogicalNetworkProperties.status = LogicalNetworkStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworkProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworksInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworksInner.java new file mode 100644 index 000000000000..60bd2d1cea8e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/LogicalNetworksInner.java @@ -0,0 +1,306 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkStatus; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.Subnet; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The logical network resource definition. + */ +@Fluent +public final class LogicalNetworksInner extends Resource { + /* + * Properties under the logical network resource + */ + private LogicalNetworkProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogicalNetworksInner class. + */ + public LogicalNetworksInner() { + } + + /** + * Get the innerProperties property: Properties under the logical network resource. + * + * @return the innerProperties value. + */ + private LogicalNetworkProperties 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 LogicalNetworksInner object itself. + */ + public LogicalNetworksInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LogicalNetworksInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LogicalNetworksInner 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 + * logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + * + * @return the dhcpOptions value. + */ + public LogicalNetworkPropertiesDhcpOptions 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 + * logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + * + * @param dhcpOptions the dhcpOptions value to set. + * @return the LogicalNetworksInner object itself. + */ + public LogicalNetworksInner withDhcpOptions(LogicalNetworkPropertiesDhcpOptions dhcpOptions) { + if (this.innerProperties() == null) { + this.innerProperties = new LogicalNetworkProperties(); + } + this.innerProperties().withDhcpOptions(dhcpOptions); + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the logical 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 logical network. + * + * @param subnets the subnets value to set. + * @return the LogicalNetworksInner object itself. + */ + public LogicalNetworksInner withSubnets(List subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new LogicalNetworkProperties(); + } + this.innerProperties().withSubnets(subnets); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the logical 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 LogicalNetworksInner object itself. + */ + public LogicalNetworksInner withVmSwitchName(String vmSwitchName) { + if (this.innerProperties() == null) { + this.innerProperties = new LogicalNetworkProperties(); + } + this.innerProperties().withVmSwitchName(vmSwitchName); + return this; + } + + /** + * Get the status property: The observed state of logical networks. + * + * @return the status value. + */ + public LogicalNetworkStatus 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworksInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworksInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogicalNetworksInner. + */ + public static LogicalNetworksInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworksInner deserializedLogicalNetworksInner = new LogicalNetworksInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogicalNetworksInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogicalNetworksInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogicalNetworksInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLogicalNetworksInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogicalNetworksInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLogicalNetworksInner.innerProperties = LogicalNetworkProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedLogicalNetworksInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogicalNetworksInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworksInner; + }); + } +} 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 000000000000..ec68fa2c4182 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImageProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties under the marketplace gallery image resource. + */ +@Fluent +public final class MarketplaceGalleryImageProperties implements JsonSerializable { + /* + * Storage ContainerID of the storage container to be used for marketplace gallery image + */ + private String containerId; + + /* + * Operating system type that the gallery image uses [Windows, Linux] + */ + private OperatingSystemTypes osType; + + /* + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] + */ + private CloudInitDataSource cloudInitDataSource; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + private HyperVGeneration hyperVGeneration; + + /* + * This is the gallery image definition identifier. + */ + private GalleryImageIdentifier identifier; + + /* + * Specifies information about the gallery image version that you want to create or update. + */ + private GalleryImageVersion version; + + /* + * Provisioning state of the marketplace gallery image. + */ + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of marketplace gallery images + */ + 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.atError() + .log(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); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("containerId", this.containerId); + jsonWriter.writeStringField("cloudInitDataSource", + this.cloudInitDataSource == null ? null : this.cloudInitDataSource.toString()); + jsonWriter.writeStringField("hyperVGeneration", + this.hyperVGeneration == null ? null : this.hyperVGeneration.toString()); + jsonWriter.writeJsonField("identifier", this.identifier); + jsonWriter.writeJsonField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImageProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImageProperties. + */ + public static MarketplaceGalleryImageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImageProperties deserializedMarketplaceGalleryImageProperties + = new MarketplaceGalleryImageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.osType + = OperatingSystemTypes.fromString(reader.getString()); + } else if ("containerId".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.containerId = reader.getString(); + } else if ("cloudInitDataSource".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.cloudInitDataSource + = CloudInitDataSource.fromString(reader.getString()); + } else if ("hyperVGeneration".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.hyperVGeneration + = HyperVGeneration.fromString(reader.getString()); + } else if ("identifier".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.identifier = GalleryImageIdentifier.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.version = GalleryImageVersion.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedMarketplaceGalleryImageProperties.status + = MarketplaceGalleryImageStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImageProperties; + }); + } +} 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 000000000000..59f9ba508c51 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/MarketplaceGalleryImagesInner.java @@ -0,0 +1,383 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * The marketplace gallery image resource definition. + */ +@Fluent +public final class MarketplaceGalleryImagesInner extends Resource { + /* + * Properties under the marketplace gallery image resource + */ + private MarketplaceGalleryImageProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImagesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImagesInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImagesInner. + */ + public static MarketplaceGalleryImagesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImagesInner deserializedMarketplaceGalleryImagesInner + = new MarketplaceGalleryImagesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMarketplaceGalleryImagesInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.innerProperties + = MarketplaceGalleryImageProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMarketplaceGalleryImagesInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImagesInner; + }); + } +} 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 000000000000..bc6f320e2237 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfaceProperties.java @@ -0,0 +1,199 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Properties under the network interface resource. + */ +@Fluent +public final class NetworkInterfaceProperties implements JsonSerializable { + /* + * IPConfigurations - A list of IPConfigurations of the network interface. + */ + private List ipConfigurations; + + /* + * MacAddress - The MAC address of the network interface. + */ + private String macAddress; + + /* + * DNS Settings for the interface + */ + private InterfaceDnsSettings dnsSettings; + + /* + * Provisioning state of the network interface. + */ + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of network interfaces + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("macAddress", this.macAddress); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceProperties. + */ + public static NetworkInterfaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceProperties deserializedNetworkInterfaceProperties = new NetworkInterfaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> IpConfiguration.fromJson(reader1)); + deserializedNetworkInterfaceProperties.ipConfigurations = ipConfigurations; + } else if ("macAddress".equals(fieldName)) { + deserializedNetworkInterfaceProperties.macAddress = reader.getString(); + } else if ("dnsSettings".equals(fieldName)) { + deserializedNetworkInterfaceProperties.dnsSettings = InterfaceDnsSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkInterfaceProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedNetworkInterfaceProperties.status = NetworkInterfaceStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceProperties; + }); + } +} 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 000000000000..9aac394d9e1e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkInterfacesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +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 + */ + private NetworkInterfaceProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfacesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfacesInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkInterfacesInner. + */ + public static NetworkInterfacesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfacesInner deserializedNetworkInterfacesInner = new NetworkInterfacesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkInterfacesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkInterfacesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkInterfacesInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkInterfacesInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkInterfacesInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkInterfacesInner.innerProperties = NetworkInterfaceProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedNetworkInterfacesInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkInterfacesInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfacesInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java index 08f059d0778d..bdbc300f5ab8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java @@ -30,9 +30,9 @@ public final class OfferInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class OfferInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of OfferInner class. @@ -69,13 +69,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -89,13 +89,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java index 90b19e0bec07..5361610b007c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java @@ -28,9 +28,9 @@ public final class PublisherInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -38,9 +38,9 @@ public final class PublisherInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of PublisherInner class. @@ -67,13 +67,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -87,13 +87,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RoutePropertiesFormat.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RoutePropertiesFormat.java new file mode 100644 index 000000000000..f2cb512ff8d2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RoutePropertiesFormat.java @@ -0,0 +1,124 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * RoutePropertiesFormat - Route resource. + */ +@Fluent +public final class RoutePropertiesFormat implements JsonSerializable { + /* + * The destination CIDR to which the route applies. + */ + private String addressPrefix; + + /* + * The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type + * is VirtualAppliance. + */ + private String nextHopIpAddress; + + /** + * Creates an instance of RoutePropertiesFormat class. + */ + public RoutePropertiesFormat() { + } + + /** + * Get the addressPrefix property: The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopIpAddress property: 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: 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 RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeStringField("nextHopIpAddress", this.nextHopIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutePropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutePropertiesFormat. + */ + public static RoutePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutePropertiesFormat deserializedRoutePropertiesFormat = new RoutePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedRoutePropertiesFormat.addressPrefix = reader.getString(); + } else if ("nextHopIpAddress".equals(fieldName)) { + deserializedRoutePropertiesFormat.nextHopIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutePropertiesFormat; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RouteTablePropertiesFormat.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RouteTablePropertiesFormat.java new file mode 100644 index 000000000000..4b3845255acb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/RouteTablePropertiesFormat.java @@ -0,0 +1,99 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.Route; +import java.io.IOException; +import java.util.List; + +/** + * RouteTablePropertiesFormat - Route Table resource. + */ +@Fluent +public final class RouteTablePropertiesFormat implements JsonSerializable { + /* + * Collection of routes contained within a route table. + */ + private List routes; + + /** + * Creates an instance of RouteTablePropertiesFormat class. + */ + public RouteTablePropertiesFormat() { + } + + /** + * Get the routes property: Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the RouteTablePropertiesFormat object itself. + */ + public RouteTablePropertiesFormat 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteTablePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteTablePropertiesFormat if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteTablePropertiesFormat. + */ + public static RouteTablePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteTablePropertiesFormat deserializedRouteTablePropertiesFormat = new RouteTablePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + List routes = reader.readArray(reader1 -> Route.fromJson(reader1)); + deserializedRouteTablePropertiesFormat.routes = routes; + } else { + reader.skipChildren(); + } + } + + return deserializedRouteTablePropertiesFormat; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecurityProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecurityProperties.java index 61e0ee98a238..92e4063cb80d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecurityProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecurityProperties.java @@ -24,16 +24,6 @@ public final class SecurityProperties implements JsonSerializable { */ private OffsetDateTime lastUpdatedTimeUtc; - /* - * Expected execution time of a given step. This is optionally authored in the update action plan and can be empty. - */ - private String expectedExecutionTime; - /* * Recursive model for child steps of this step. */ @@ -214,28 +209,6 @@ public Step withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { return this; } - /** - * Get the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @return the expectedExecutionTime value. - */ - public String expectedExecutionTime() { - return this.expectedExecutionTime; - } - - /** - * Set the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @param expectedExecutionTime the expectedExecutionTime value to set. - * @return the Step object itself. - */ - public Step withExpectedExecutionTime(String expectedExecutionTime) { - this.expectedExecutionTime = expectedExecutionTime; - return this; - } - /** * Get the steps property: Recursive model for child steps of this step. * @@ -285,7 +258,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.lastUpdatedTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTimeUtc)); - jsonWriter.writeStringField("expectedExecutionTime", this.expectedExecutionTime); jsonWriter.writeArrayField("steps", this.steps, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -322,8 +294,6 @@ public static Step fromJson(JsonReader jsonReader) throws IOException { } else if ("lastUpdatedTimeUtc".equals(fieldName)) { deserializedStep.lastUpdatedTimeUtc = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("expectedExecutionTime".equals(fieldName)) { - deserializedStep.expectedExecutionTime = reader.getString(); } else if ("steps".equals(fieldName)) { List steps = reader.readArray(reader1 -> Step.fromJson(reader1)); deserializedStep.steps = steps; 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 000000000000..13eee6d92d4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainerProperties.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus; +import java.io.IOException; + +/** + * Properties under the storage container resource. + */ +@Fluent +public final class StorageContainerProperties implements JsonSerializable { + /* + * Path of the storage container on the disk + */ + private String path; + + /* + * Provisioning state of the storage container. + */ + private ProvisioningStateEnum provisioningState; + + /* + * The observed state of storage containers + */ + 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 (path() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property path in model StorageContainerProperties")); + } + if (status() != null) { + status().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageContainerProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainerProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StorageContainerProperties. + */ + public static StorageContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainerProperties deserializedStorageContainerProperties = new StorageContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedStorageContainerProperties.path = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageContainerProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedStorageContainerProperties.status = StorageContainerStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainerProperties; + }); + } +} 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 000000000000..7d515eac7fcd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StorageContainersInner.java @@ -0,0 +1,255 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus; +import java.io.IOException; +import java.util.Map; + +/** + * The storage container resource definition. + */ +@Fluent +public final class StorageContainersInner extends Resource { + /* + * Properties under the storage container resource + */ + private StorageContainerProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainersInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StorageContainersInner. + */ + public static StorageContainersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainersInner deserializedStorageContainersInner = new StorageContainersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageContainersInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageContainersInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageContainersInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedStorageContainersInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageContainersInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedStorageContainersInner.innerProperties = StorageContainerProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageContainersInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStorageContainersInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainersInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SubnetPropertiesFormat.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SubnetPropertiesFormat.java new file mode 100644 index 000000000000..cdb70a116a70 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SubnetPropertiesFormat.java @@ -0,0 +1,286 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.IpAllocationMethodEnum; +import com.azure.resourcemanager.azurestackhci.models.IpPool; +import com.azure.resourcemanager.azurestackhci.models.RouteTable; +import com.azure.resourcemanager.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the subnet. + */ +@Fluent +public final class SubnetPropertiesFormat implements JsonSerializable { + /* + * The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + */ + private String addressPrefix; + + /* + * List of address prefixes for the subnet. + */ + private List addressPrefixes; + + /* + * IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' + */ + private IpAllocationMethodEnum ipAllocationMethod; + + /* + * IPConfigurationReferences - list of IPConfigurationReferences + */ + private List ipConfigurationReferences; + + /* + * Route table resource. + */ + private RouteTable routeTable; + + /* + * network associated pool of IP Addresses + */ + private List ipPools; + + /* + * Vlan to use for the subnet + */ + private Integer vlan; + + /** + * Creates an instance of SubnetPropertiesFormat class. + */ + public SubnetPropertiesFormat() { + } + + /** + * Get the addressPrefix property: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the addressPrefixes property: List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat 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 SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat 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 SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat withIpConfigurationReferences( + List ipConfigurationReferences) { + this.ipConfigurationReferences = ipConfigurationReferences; + return this; + } + + /** + * Get the routeTable property: Route table resource. + * + * @return the routeTable value. + */ + public RouteTable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable property: Route table resource. + * + * @param routeTable the routeTable value to set. + * @return the SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat withRouteTable(RouteTable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the ipPools property: network associated pool of IP Addresses. + * + * @return the ipPools value. + */ + public List ipPools() { + return this.ipPools; + } + + /** + * Set the ipPools property: network associated pool of IP Addresses. + * + * @param ipPools the ipPools value to set. + * @return the SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat withIpPools(List ipPools) { + this.ipPools = ipPools; + 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 SubnetPropertiesFormat object itself. + */ + public SubnetPropertiesFormat 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(); + } + if (ipPools() != null) { + ipPools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("ipAllocationMethod", + this.ipAllocationMethod == null ? null : this.ipAllocationMethod.toString()); + jsonWriter.writeArrayField("ipConfigurationReferences", this.ipConfigurationReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("routeTable", this.routeTable); + jsonWriter.writeArrayField("ipPools", this.ipPools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("vlan", this.vlan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetPropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetPropertiesFormat. + */ + public static SubnetPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetPropertiesFormat deserializedSubnetPropertiesFormat = new SubnetPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedSubnetPropertiesFormat.addressPrefix = reader.getString(); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedSubnetPropertiesFormat.addressPrefixes = addressPrefixes; + } else if ("ipAllocationMethod".equals(fieldName)) { + deserializedSubnetPropertiesFormat.ipAllocationMethod + = IpAllocationMethodEnum.fromString(reader.getString()); + } else if ("ipConfigurationReferences".equals(fieldName)) { + List ipConfigurationReferences = reader + .readArray(reader1 -> SubnetPropertiesFormatIpConfigurationReferencesItem.fromJson(reader1)); + deserializedSubnetPropertiesFormat.ipConfigurationReferences = ipConfigurationReferences; + } else if ("routeTable".equals(fieldName)) { + deserializedSubnetPropertiesFormat.routeTable = RouteTable.fromJson(reader); + } else if ("ipPools".equals(fieldName)) { + List ipPools = reader.readArray(reader1 -> IpPool.fromJson(reader1)); + deserializedSubnetPropertiesFormat.ipPools = ipPools; + } else if ("vlan".equals(fieldName)) { + deserializedSubnetPropertiesFormat.vlan = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetPropertiesFormat; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java index eb137ccec19a..e18efdf7e1ab 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java @@ -43,11 +43,6 @@ public final class UpdateProperties implements JsonSerializable writer.writeJson(element)); jsonWriter.writeArrayField("componentVersions", this.componentVersions, @@ -681,8 +655,6 @@ public static UpdateProperties fromJson(JsonReader jsonReader) throws IOExceptio .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("description".equals(fieldName)) { deserializedUpdateProperties.description = reader.getString(); - } else if ("minSbeVersionRequired".equals(fieldName)) { - deserializedUpdateProperties.minSbeVersionRequired = reader.getString(); } else if ("state".equals(fieldName)) { deserializedUpdateProperties.state = State.fromString(reader.getString()); } else if ("prerequisites".equals(fieldName)) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java index f20578cd3d95..ab4d7a2f84f5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java @@ -37,9 +37,9 @@ public final class UpdateRunInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -47,9 +47,9 @@ public final class UpdateRunInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of UpdateRunInner class. @@ -96,13 +96,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -116,13 +116,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -389,31 +389,6 @@ public UpdateRunInner withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) return this; } - /** - * Get the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @return the expectedExecutionTime value. - */ - public String expectedExecutionTime() { - return this.innerProperties() == null ? null : this.innerProperties().expectedExecutionTime(); - } - - /** - * Set the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @param expectedExecutionTime the expectedExecutionTime value to set. - * @return the UpdateRunInner object itself. - */ - public UpdateRunInner withExpectedExecutionTime(String expectedExecutionTime) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateRunProperties(); - } - this.innerProperties().withExpectedExecutionTime(expectedExecutionTime); - return this; - } - /** * Get the steps property: Recursive model for child steps of this step. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java index d594f9b7c4cb..f1cc3eca2b10 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java @@ -319,31 +319,6 @@ public UpdateRunProperties withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTime return this; } - /** - * Get the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @return the expectedExecutionTime value. - */ - public String expectedExecutionTime() { - return this.innerProgress() == null ? null : this.innerProgress().expectedExecutionTime(); - } - - /** - * Set the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @param expectedExecutionTime the expectedExecutionTime value to set. - * @return the UpdateRunProperties object itself. - */ - public UpdateRunProperties withExpectedExecutionTime(String expectedExecutionTime) { - if (this.innerProgress() == null) { - this.innerProgress = new Step(); - } - this.innerProgress().withExpectedExecutionTime(expectedExecutionTime); - return this; - } - /** * Get the steps property: Recursive model for child steps of this step. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java index 492c19f22ed8..a4db3e33ffe5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java @@ -40,9 +40,9 @@ public final class UpdateSummariesInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -50,9 +50,9 @@ public final class UpdateSummariesInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of UpdateSummariesInner class. @@ -99,13 +99,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -119,13 +119,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -160,29 +160,6 @@ public UpdateSummariesInner withOemFamily(String oemFamily) { return this; } - /** - * Get the currentOemVersion property: Current OEM Version. - * - * @return the currentOemVersion value. - */ - public String currentOemVersion() { - return this.innerProperties() == null ? null : this.innerProperties().currentOemVersion(); - } - - /** - * Set the currentOemVersion property: Current OEM Version. - * - * @param currentOemVersion the currentOemVersion value to set. - * @return the UpdateSummariesInner object itself. - */ - public UpdateSummariesInner withCurrentOemVersion(String currentOemVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummariesProperties(); - } - this.innerProperties().withCurrentOemVersion(currentOemVersion); - return this; - } - /** * Get the hardwareModel property: Name of the hardware model. * @@ -252,29 +229,6 @@ public UpdateSummariesInner withCurrentVersion(String currentVersion) { return this; } - /** - * Get the currentSbeVersion property: Current Sbe version of the stamp. - * - * @return the currentSbeVersion value. - */ - public String currentSbeVersion() { - return this.innerProperties() == null ? null : this.innerProperties().currentSbeVersion(); - } - - /** - * Set the currentSbeVersion property: Current Sbe version of the stamp. - * - * @param currentSbeVersion the currentSbeVersion value to set. - * @return the UpdateSummariesInner object itself. - */ - public UpdateSummariesInner withCurrentSbeVersion(String currentSbeVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummariesProperties(); - } - this.innerProperties().withCurrentSbeVersion(currentSbeVersion); - return this; - } - /** * Get the lastUpdated property: Last time an update installation completed successfully. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java index ed82d85ee402..096ec118ec96 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java @@ -35,11 +35,6 @@ public final class UpdateSummariesProperties implements JsonSerializable writer.writeJson(element)); jsonWriter.writeStringField("currentVersion", this.currentVersion); - jsonWriter.writeStringField("currentSbeVersion", this.currentSbeVersion); jsonWriter.writeStringField("lastUpdated", this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); jsonWriter.writeStringField("lastChecked", @@ -405,8 +353,6 @@ public static UpdateSummariesProperties fromJson(JsonReader jsonReader) throws I = ProvisioningState.fromString(reader.getString()); } else if ("oemFamily".equals(fieldName)) { deserializedUpdateSummariesProperties.oemFamily = reader.getString(); - } else if ("currentOemVersion".equals(fieldName)) { - deserializedUpdateSummariesProperties.currentOemVersion = reader.getString(); } else if ("hardwareModel".equals(fieldName)) { deserializedUpdateSummariesProperties.hardwareModel = reader.getString(); } else if ("packageVersions".equals(fieldName)) { @@ -415,8 +361,6 @@ public static UpdateSummariesProperties fromJson(JsonReader jsonReader) throws I deserializedUpdateSummariesProperties.packageVersions = packageVersions; } else if ("currentVersion".equals(fieldName)) { deserializedUpdateSummariesProperties.currentVersion = reader.getString(); - } else if ("currentSbeVersion".equals(fieldName)) { - deserializedUpdateSummariesProperties.currentSbeVersion = reader.getString(); } else if ("lastUpdated".equals(fieldName)) { deserializedUpdateSummariesProperties.lastUpdated = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); 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 000000000000..cf45d61ffc18 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDiskProperties.java @@ -0,0 +1,333 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties under the virtual hard disk resource. + */ +@Fluent +public final class VirtualHardDiskProperties implements JsonSerializable { + /* + * The blockSizeBytes property. + */ + private Integer blockSizeBytes; + + /* + * Size of the disk in GB + */ + private Long diskSizeGB; + + /* + * Boolean for enabling dynamic sizing on the virtual hard disk + */ + private Boolean dynamic; + + /* + * The logicalSectorBytes property. + */ + private Integer logicalSectorBytes; + + /* + * The physicalSectorBytes property. + */ + private Integer physicalSectorBytes; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + private HyperVGeneration hyperVGeneration; + + /* + * The format of the actual VHD file [vhd, vhdx] + */ + private DiskFileFormat diskFileFormat; + + /* + * Provisioning state of the virtual hard disk. + */ + private ProvisioningStateEnum provisioningState; + + /* + * Storage ContainerID of the storage container to be used for VHD + */ + private String containerId; + + /* + * The observed state of virtual hard disks + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("blockSizeBytes", this.blockSizeBytes); + jsonWriter.writeNumberField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeBooleanField("dynamic", this.dynamic); + jsonWriter.writeNumberField("logicalSectorBytes", this.logicalSectorBytes); + jsonWriter.writeNumberField("physicalSectorBytes", this.physicalSectorBytes); + jsonWriter.writeStringField("hyperVGeneration", + this.hyperVGeneration == null ? null : this.hyperVGeneration.toString()); + jsonWriter.writeStringField("diskFileFormat", + this.diskFileFormat == null ? null : this.diskFileFormat.toString()); + jsonWriter.writeStringField("containerId", this.containerId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDiskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDiskProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDiskProperties. + */ + public static VirtualHardDiskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDiskProperties deserializedVirtualHardDiskProperties = new VirtualHardDiskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blockSizeBytes".equals(fieldName)) { + deserializedVirtualHardDiskProperties.blockSizeBytes = reader.getNullable(JsonReader::getInt); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedVirtualHardDiskProperties.diskSizeGB = reader.getNullable(JsonReader::getLong); + } else if ("dynamic".equals(fieldName)) { + deserializedVirtualHardDiskProperties.dynamic = reader.getNullable(JsonReader::getBoolean); + } else if ("logicalSectorBytes".equals(fieldName)) { + deserializedVirtualHardDiskProperties.logicalSectorBytes = reader.getNullable(JsonReader::getInt); + } else if ("physicalSectorBytes".equals(fieldName)) { + deserializedVirtualHardDiskProperties.physicalSectorBytes = reader.getNullable(JsonReader::getInt); + } else if ("hyperVGeneration".equals(fieldName)) { + deserializedVirtualHardDiskProperties.hyperVGeneration + = HyperVGeneration.fromString(reader.getString()); + } else if ("diskFileFormat".equals(fieldName)) { + deserializedVirtualHardDiskProperties.diskFileFormat + = DiskFileFormat.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualHardDiskProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("containerId".equals(fieldName)) { + deserializedVirtualHardDiskProperties.containerId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedVirtualHardDiskProperties.status = VirtualHardDiskStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDiskProperties; + }); + } +} 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 000000000000..c06dc83ca651 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualHardDisksInner.java @@ -0,0 +1,418 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * The virtual hard disk resource definition. + */ +@Fluent +public final class VirtualHardDisksInner extends Resource { + /* + * Properties under the virtual hard disk resource + */ + private VirtualHardDiskProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDisksInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDisksInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualHardDisksInner. + */ + public static VirtualHardDisksInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDisksInner deserializedVirtualHardDisksInner = new VirtualHardDisksInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualHardDisksInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVirtualHardDisksInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualHardDisksInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualHardDisksInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualHardDisksInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualHardDisksInner.innerProperties = VirtualHardDiskProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVirtualHardDisksInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVirtualHardDisksInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDisksInner; + }); + } +} 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 000000000000..d3e4397f679b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceInner.java @@ -0,0 +1,461 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus; +import com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration; +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 java.io.IOException; + +/** + * The virtual machine instance resource definition. + */ +@Fluent +public final class VirtualMachineInstanceInner extends ProxyResource { + /* + * Properties under the virtual machine instance resource + */ + private VirtualMachineInstanceProperties innerProperties; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Identity for the resource. + */ + private Identity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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 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 VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withHttpProxyConfig(httpProxyConfig); + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceInner. + */ + public static VirtualMachineInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceInner deserializedVirtualMachineInstanceInner = new VirtualMachineInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.innerProperties + = VirtualMachineInstanceProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.identity = Identity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVirtualMachineInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceInner; + }); + } +} 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 000000000000..f00aa6be050c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualMachineInstanceProperties.java @@ -0,0 +1,413 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus; +import com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration; +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 java.io.IOException; + +/** + * Properties under the virtual machine instance resource. + */ +@Fluent +public final class VirtualMachineInstanceProperties implements JsonSerializable { + /* + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ + private VirtualMachineInstancePropertiesHardwareProfile hardwareProfile; + + /* + * NetworkProfile - describes the network configuration the virtual machine instance + */ + private VirtualMachineInstancePropertiesNetworkProfile networkProfile; + + /* + * OsProfile - describes the configuration of the operating system and sets login data + */ + private VirtualMachineInstancePropertiesOsProfile osProfile; + + /* + * SecurityProfile - Specifies the security settings for the virtual machine instance. + */ + private VirtualMachineInstancePropertiesSecurityProfile securityProfile; + + /* + * StorageProfile - contains information about the disks and storage information for the virtual machine instance + */ + private VirtualMachineInstancePropertiesStorageProfile storageProfile; + + /* + * HTTP Proxy configuration for the VM. + */ + private HttpProxyConfiguration httpProxyConfig; + + /* + * Provisioning state of the virtual machine instance. + */ + private ProvisioningStateEnum provisioningState; + + /* + * The virtual machine instance view. + */ + private VirtualMachineInstanceView instanceView; + + /* + * The observed state of virtual machine instances + */ + private VirtualMachineInstanceStatus status; + + /* + * Guest agent install status. + */ + private GuestAgentInstallStatus guestAgentInstallStatus; + + /* + * Unique identifier for the vm resource. + */ + private String vmId; + + /* + * Unique identifier defined by ARC to identify the guest of the VM. + */ + 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 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 VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { + this.httpProxyConfig = httpProxyConfig; + 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 (httpProxyConfig() != null) { + httpProxyConfig().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (status() != null) { + status().validate(); + } + if (guestAgentInstallStatus() != null) { + guestAgentInstallStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hardwareProfile", this.hardwareProfile); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("osProfile", this.osProfile); + jsonWriter.writeJsonField("securityProfile", this.securityProfile); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeJsonField("httpProxyConfig", this.httpProxyConfig); + jsonWriter.writeJsonField("guestAgentInstallStatus", this.guestAgentInstallStatus); + jsonWriter.writeStringField("resourceUid", this.resourceUid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceProperties. + */ + public static VirtualMachineInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceProperties deserializedVirtualMachineInstanceProperties + = new VirtualMachineInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hardwareProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.hardwareProfile + = VirtualMachineInstancePropertiesHardwareProfile.fromJson(reader); + } else if ("networkProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.networkProfile + = VirtualMachineInstancePropertiesNetworkProfile.fromJson(reader); + } else if ("osProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.osProfile + = VirtualMachineInstancePropertiesOsProfile.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.securityProfile + = VirtualMachineInstancePropertiesSecurityProfile.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.storageProfile + = VirtualMachineInstancePropertiesStorageProfile.fromJson(reader); + } else if ("httpProxyConfig".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.httpProxyConfig + = HttpProxyConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("instanceView".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.instanceView + = VirtualMachineInstanceView.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.status = VirtualMachineInstanceStatus.fromJson(reader); + } else if ("guestAgentInstallStatus".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.guestAgentInstallStatus + = GuestAgentInstallStatus.fromJson(reader); + } else if ("vmId".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.vmId = reader.getString(); + } else if ("resourceUid".equals(fieldName)) { + deserializedVirtualMachineInstanceProperties.resourceUid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceProperties; + }); + } +} 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 index 54ac1517757b..9bc836de20d3 100644 --- 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 @@ -10,10 +10,10 @@ public final class ArcIdentityResponseImpl implements ArcIdentityResponse { private ArcIdentityResponseInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; ArcIdentityResponseImpl(ArcIdentityResponseInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -38,7 +38,7 @@ public ArcIdentityResponseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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 index 36a7f582212d..fcf07600ca48 100644 --- 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 @@ -23,7 +23,7 @@ public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition, ArcSetting.Update { private ArcSettingInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -99,7 +99,7 @@ public ArcSettingInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -133,7 +133,7 @@ public ArcSetting create(Context context) { return this; } - ArcSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + ArcSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new ArcSettingInner(); this.serviceManager = serviceManager; this.arcSettingName = name; @@ -161,7 +161,7 @@ public ArcSetting apply(Context context) { } ArcSettingImpl(ArcSettingInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); 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 index 6763384442bd..b6db532bd919 100644 --- 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 @@ -23,10 +23,10 @@ public final class ArcSettingsImpl implements ArcSettings { private final ArcSettingsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public ArcSettingsImpl(ArcSettingsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -226,7 +226,7 @@ private ArcSettingsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index 8a91bf54edb8..3f101035c8aa 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 @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { AzureStackHciClientImpl.class }) public final class AzureStackHciClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the AzureStackHciClientBuilder. 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 1a75e162c02e..b3f1328c6fa6 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 @@ -13,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -29,14 +29,24 @@ import com.azure.resourcemanager.azurestackhci.fluent.DeploymentSettingsClient; import com.azure.resourcemanager.azurestackhci.fluent.EdgeDevicesClient; import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +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.LogicalNetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.MarketplaceGalleryImagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.NetworkInterfacesOperationsClient; import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; import com.azure.resourcemanager.azurestackhci.fluent.SecuritySettingsClient; import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.StorageContainersOperationsClient; import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; -import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualHardDisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualMachineInstancesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -52,12 +62,12 @@ @ServiceClient(builder = AzureStackHciClientBuilder.class) public final class AzureStackHciClientImpl implements AzureStackHciClient { /** - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -205,6 +215,62 @@ public ExtensionsClient getExtensions() { return this.extensions; } + /** + * The GalleryImagesOperationsClient object to access its operations. + */ + private final GalleryImagesOperationsClient galleryImagesOperations; + + /** + * Gets the GalleryImagesOperationsClient object to access its operations. + * + * @return the GalleryImagesOperationsClient object. + */ + public GalleryImagesOperationsClient getGalleryImagesOperations() { + return this.galleryImagesOperations; + } + + /** + * The LogicalNetworksOperationsClient object to access its operations. + */ + private final LogicalNetworksOperationsClient logicalNetworksOperations; + + /** + * Gets the LogicalNetworksOperationsClient object to access its operations. + * + * @return the LogicalNetworksOperationsClient object. + */ + public LogicalNetworksOperationsClient getLogicalNetworksOperations() { + return this.logicalNetworksOperations; + } + + /** + * The MarketplaceGalleryImagesOperationsClient object to access its operations. + */ + private final MarketplaceGalleryImagesOperationsClient marketplaceGalleryImagesOperations; + + /** + * Gets the MarketplaceGalleryImagesOperationsClient object to access its operations. + * + * @return the MarketplaceGalleryImagesOperationsClient object. + */ + public MarketplaceGalleryImagesOperationsClient getMarketplaceGalleryImagesOperations() { + return this.marketplaceGalleryImagesOperations; + } + + /** + * The NetworkInterfacesOperationsClient object to access its operations. + */ + private final NetworkInterfacesOperationsClient networkInterfacesOperations; + + /** + * Gets the NetworkInterfacesOperationsClient object to access its operations. + * + * @return the NetworkInterfacesOperationsClient object. + */ + public NetworkInterfacesOperationsClient getNetworkInterfacesOperations() { + return this.networkInterfacesOperations; + } + /** * The OffersClient object to access its operations. */ @@ -275,6 +341,20 @@ public SkusClient getSkus() { return this.skus; } + /** + * The StorageContainersOperationsClient object to access its operations. + */ + private final StorageContainersOperationsClient storageContainersOperations; + + /** + * Gets the StorageContainersOperationsClient object to access its operations. + * + * @return the StorageContainersOperationsClient object. + */ + public StorageContainersOperationsClient getStorageContainersOperations() { + return this.storageContainersOperations; + } + /** * The UpdateRunsClient object to access its operations. */ @@ -317,6 +397,76 @@ public UpdatesClient getUpdates() { return this.updates; } + /** + * 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; + } + /** * Initializes an instance of AzureStackHciClient client. * @@ -324,7 +474,7 @@ public UpdatesClient getUpdates() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ AzureStackHciClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -334,20 +484,30 @@ public UpdatesClient getUpdates() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-04-01"; + this.apiVersion = "2024-01-01"; this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.deploymentSettings = new DeploymentSettingsClientImpl(this); this.edgeDevices = new EdgeDevicesClientImpl(this); this.extensions = new ExtensionsClientImpl(this); + this.galleryImagesOperations = new GalleryImagesOperationsClientImpl(this); + this.logicalNetworksOperations = new LogicalNetworksOperationsClientImpl(this); + this.marketplaceGalleryImagesOperations = new MarketplaceGalleryImagesOperationsClientImpl(this); + this.networkInterfacesOperations = new NetworkInterfacesOperationsClientImpl(this); this.offers = new OffersClientImpl(this); this.operations = new OperationsClientImpl(this); this.publishers = new PublishersClientImpl(this); this.securitySettings = new SecuritySettingsClientImpl(this); this.skus = new SkusClientImpl(this); + this.storageContainersOperations = new StorageContainersOperationsClientImpl(this); this.updateRuns = new UpdateRunsClientImpl(this); this.updateSummariesOperations = new UpdateSummariesOperationsClientImpl(this); this.updates = new UpdatesClientImpl(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); } /** 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 index 54b4e3a155b0..20118ebd6cd9 100644 --- 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 @@ -10,10 +10,10 @@ public final class ClusterIdentityResponseImpl implements ClusterIdentityResponse { private ClusterIdentityResponseInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; ClusterIdentityResponseImpl(ClusterIdentityResponseInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -38,7 +38,7 @@ public ClusterIdentityResponseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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 index 93a05b49edbe..4c2497feb076 100644 --- 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 @@ -15,12 +15,8 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ConnectivityStatus; import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionProperties; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequest; import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; @@ -34,7 +30,7 @@ public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { private ClusterInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -126,14 +122,6 @@ public SoftwareAssuranceProperties softwareAssuranceProperties() { return this.innerModel().softwareAssuranceProperties(); } - public LogCollectionProperties logCollectionProperties() { - return this.innerModel().logCollectionProperties(); - } - - public RemoteSupportProperties remoteSupportProperties() { - return this.innerModel().remoteSupportProperties(); - } - public ClusterDesiredProperties desiredProperties() { return this.innerModel().desiredProperties(); } @@ -190,7 +178,7 @@ public ClusterInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -221,7 +209,7 @@ public Cluster create(Context context) { return this; } - ClusterImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + ClusterImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new ClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -248,7 +236,7 @@ public Cluster apply(Context context) { return this; } - ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -298,24 +286,6 @@ public Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest sof .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); } - public Cluster triggerLogCollection(LogCollectionRequest logCollectionRequest) { - return serviceManager.clusters().triggerLogCollection(resourceGroupName, clusterName, logCollectionRequest); - } - - public Cluster triggerLogCollection(LogCollectionRequest logCollectionRequest, Context context) { - return serviceManager.clusters() - .triggerLogCollection(resourceGroupName, clusterName, logCollectionRequest, context); - } - - public Cluster configureRemoteSupport(RemoteSupportRequest remoteSupportRequest) { - return serviceManager.clusters().configureRemoteSupport(resourceGroupName, clusterName, remoteSupportRequest); - } - - public Cluster configureRemoteSupport(RemoteSupportRequest remoteSupportRequest, Context context) { - return serviceManager.clusters() - .configureRemoteSupport(resourceGroupName, clusterName, remoteSupportRequest, context); - } - public ClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -396,16 +366,6 @@ public ClusterImpl withSoftwareAssuranceProperties(SoftwareAssuranceProperties s return this; } - public ClusterImpl withLogCollectionProperties(LogCollectionProperties logCollectionProperties) { - this.innerModel().withLogCollectionProperties(logCollectionProperties); - return this; - } - - public ClusterImpl withRemoteSupportProperties(RemoteSupportProperties remoteSupportProperties) { - this.innerModel().withRemoteSupportProperties(remoteSupportProperties); - return this; - } - public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { if (isInCreateMode()) { this.innerModel().withDesiredProperties(desiredProperties); 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/ClustersClientImpl.java index 811b6d9c6118..0fe7aef89690 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/ClustersClientImpl.java @@ -38,8 +38,6 @@ 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.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; import java.nio.ByteBuffer; @@ -163,28 +161,6 @@ Mono>> extendSoftwareAssuranceBenefit(@HostParam("$hos @BodyParam("application/json") SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/triggerLogCollection") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> triggerLogCollection(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LogCollectionRequest logCollectionRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/configureRemoteSupport") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> configureRemoteSupport(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RemoteSupportRequest remoteSupportRequest, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1708,478 +1684,6 @@ public ClusterInner extendSoftwareAssuranceBenefit(String resourceGroupName, Str context).block(); } - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerLogCollectionWithResponseAsync(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest) { - 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 (logCollectionRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter logCollectionRequest is required and cannot be null.")); - } else { - logCollectionRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.triggerLogCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), logCollectionRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerLogCollectionWithResponseAsync(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest, 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 (logCollectionRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter logCollectionRequest is required and cannot be null.")); - } else { - logCollectionRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.triggerLogCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), logCollectionRequest, accept, context); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginTriggerLogCollectionAsync(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest) { - Mono>> mono - = triggerLogCollectionWithResponseAsync(resourceGroupName, clusterName, logCollectionRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginTriggerLogCollectionAsync(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = triggerLogCollectionWithResponseAsync(resourceGroupName, clusterName, logCollectionRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 SyncPoller} for polling of cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterInner> beginTriggerLogCollection(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest) { - return this.beginTriggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest) - .getSyncPoller(); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterInner> beginTriggerLogCollection(String resourceGroupName, - String clusterName, LogCollectionRequest logCollectionRequest, Context context) { - return this.beginTriggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest, context) - .getSyncPoller(); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerLogCollectionAsync(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest) { - return beginTriggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerLogCollectionAsync(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest, Context context) { - return beginTriggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest) { - return triggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest).block(); - } - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest, Context context) { - return triggerLogCollectionAsync(resourceGroupName, clusterName, logCollectionRequest, context).block(); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> configureRemoteSupportWithResponseAsync(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest) { - 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 (remoteSupportRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter remoteSupportRequest is required and cannot be null.")); - } else { - remoteSupportRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.configureRemoteSupport(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), remoteSupportRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> configureRemoteSupportWithResponseAsync(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest, 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 (remoteSupportRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter remoteSupportRequest is required and cannot be null.")); - } else { - remoteSupportRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.configureRemoteSupport(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), remoteSupportRequest, accept, context); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginConfigureRemoteSupportAsync( - String resourceGroupName, String clusterName, RemoteSupportRequest remoteSupportRequest) { - Mono>> mono - = configureRemoteSupportWithResponseAsync(resourceGroupName, clusterName, remoteSupportRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginConfigureRemoteSupportAsync( - String resourceGroupName, String clusterName, RemoteSupportRequest remoteSupportRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = configureRemoteSupportWithResponseAsync(resourceGroupName, clusterName, remoteSupportRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 SyncPoller} for polling of cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterInner> beginConfigureRemoteSupport(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest) { - return this.beginConfigureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest) - .getSyncPoller(); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterInner> beginConfigureRemoteSupport(String resourceGroupName, - String clusterName, RemoteSupportRequest remoteSupportRequest, Context context) { - return this.beginConfigureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest, context) - .getSyncPoller(); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono configureRemoteSupportAsync(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest) { - return beginConfigureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono configureRemoteSupportAsync(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest, Context context) { - return beginConfigureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest) { - return configureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest).block(); - } - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest, Context context) { - return configureRemoteSupportAsync(resourceGroupName, clusterName, remoteSupportRequest, context).block(); - } - /** * Get the next page of items. * 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 index a807837fa7a3..a17c40c6cc94 100644 --- 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 @@ -15,8 +15,6 @@ 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.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; @@ -25,10 +23,10 @@ public final class ClustersImpl implements Clusters { private final ClustersClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public ClustersImpl(ClustersClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -133,50 +131,6 @@ public Cluster extendSoftwareAssuranceBenefit(String resourceGroupName, String c } } - public Cluster triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest) { - ClusterInner inner - = this.serviceClient().triggerLogCollection(resourceGroupName, clusterName, logCollectionRequest); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public Cluster triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest, Context context) { - ClusterInner inner - = this.serviceClient().triggerLogCollection(resourceGroupName, clusterName, logCollectionRequest, context); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public Cluster configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest) { - ClusterInner inner - = this.serviceClient().configureRemoteSupport(resourceGroupName, clusterName, remoteSupportRequest); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public Cluster configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest, Context context) { - ClusterInner inner = this.serviceClient() - .configureRemoteSupport(resourceGroupName, clusterName, remoteSupportRequest, context); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - public Cluster getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -237,7 +191,7 @@ private ClustersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/DeploymentSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java index c541771b75ad..58ac4aa6837d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java @@ -10,9 +10,8 @@ import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration; import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; import com.azure.resourcemanager.azurestackhci.models.DeploymentSetting; -import com.azure.resourcemanager.azurestackhci.models.EceReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.OperationType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.ReportedProperties; import java.util.Collections; import java.util.List; @@ -20,7 +19,7 @@ public final class DeploymentSettingImpl implements DeploymentSetting, DeploymentSetting.Definition, DeploymentSetting.Update { private DeploymentSettingInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -55,15 +54,11 @@ public DeploymentMode deploymentMode() { return this.innerModel().deploymentMode(); } - public OperationType operationType() { - return this.innerModel().operationType(); - } - public DeploymentConfiguration deploymentConfiguration() { return this.innerModel().deploymentConfiguration(); } - public EceReportedProperties reportedProperties() { + public ReportedProperties reportedProperties() { return this.innerModel().reportedProperties(); } @@ -75,7 +70,7 @@ public DeploymentSettingInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -105,7 +100,7 @@ public DeploymentSetting create(Context context) { return this; } - DeploymentSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + DeploymentSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new DeploymentSettingInner(); this.serviceManager = serviceManager; this.deploymentSettingsName = name; @@ -130,7 +125,7 @@ public DeploymentSetting apply(Context context) { } DeploymentSettingImpl(DeploymentSettingInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -154,6 +149,11 @@ public DeploymentSetting refresh(Context context) { return this; } + public DeploymentSettingImpl withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + public DeploymentSettingImpl withArcNodeResourceIds(List arcNodeResourceIds) { this.innerModel().withArcNodeResourceIds(arcNodeResourceIds); return this; @@ -164,11 +164,6 @@ public DeploymentSettingImpl withDeploymentMode(DeploymentMode deploymentMode) { return this; } - public DeploymentSettingImpl withOperationType(OperationType operationType) { - this.innerModel().withOperationType(operationType); - return this; - } - public DeploymentSettingImpl withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { this.innerModel().withDeploymentConfiguration(deploymentConfiguration); return this; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java index 67cf3f75119c..071f67a76ee9 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java @@ -19,10 +19,10 @@ public final class DeploymentSettingsImpl implements DeploymentSettings { private final DeploymentSettingsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public DeploymentSettingsImpl(DeploymentSettingsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -149,7 +149,7 @@ private DeploymentSettingsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/EdgeDeviceImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDeviceImpl.java index 1e29703bba70..c9fa1553c9ef 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDeviceImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDeviceImpl.java @@ -5,20 +5,18 @@ 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.EdgeDeviceInner; -import com.azure.resourcemanager.azurestackhci.models.DeviceKind; +import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; import com.azure.resourcemanager.azurestackhci.models.EdgeDevice; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; +import com.azure.resourcemanager.azurestackhci.models.ValidateResponse; -public final class EdgeDeviceImpl implements EdgeDevice { +public final class EdgeDeviceImpl implements EdgeDevice, EdgeDevice.Definition, EdgeDevice.Update { private EdgeDeviceInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - EdgeDeviceImpl(EdgeDeviceInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -32,19 +30,114 @@ public String type() { return this.innerModel().type(); } - public DeviceKind kind() { - return this.innerModel().kind(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public DeviceConfiguration deviceConfiguration() { + return this.innerModel().deviceConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + public EdgeDeviceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } + + private String resourceUri; + + private String edgeDeviceName; + + public EdgeDeviceImpl withExistingResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + public EdgeDevice create() { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .createOrUpdate(resourceUri, edgeDeviceName, this.innerModel(), Context.NONE); + return this; + } + + public EdgeDevice create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .createOrUpdate(resourceUri, edgeDeviceName, this.innerModel(), context); + return this; + } + + EdgeDeviceImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { + this.innerObject = new EdgeDeviceInner(); + this.serviceManager = serviceManager; + this.edgeDeviceName = name; + } + + public EdgeDeviceImpl update() { + return this; + } + + public EdgeDevice apply() { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .createOrUpdate(resourceUri, edgeDeviceName, this.innerModel(), Context.NONE); + return this; + } + + public EdgeDevice apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .createOrUpdate(resourceUri, edgeDeviceName, this.innerModel(), context); + return this; + } + + EdgeDeviceImpl(EdgeDeviceInner innerObject, + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "resourceUri"); + this.edgeDeviceName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "edgeDeviceName"); + } + + public EdgeDevice refresh() { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .getWithResponse(resourceUri, edgeDeviceName, Context.NONE) + .getValue(); + return this; + } + + public EdgeDevice refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeDevices() + .getWithResponse(resourceUri, edgeDeviceName, context) + .getValue(); + return this; + } + + public ValidateResponse validate(ValidateRequest validateRequest) { + return serviceManager.edgeDevices().validate(resourceUri, edgeDeviceName, validateRequest); + } + + public ValidateResponse validate(ValidateRequest validateRequest, Context context) { + return serviceManager.edgeDevices().validate(resourceUri, edgeDeviceName, validateRequest, context); + } + + public EdgeDeviceImpl withDeviceConfiguration(DeviceConfiguration deviceConfiguration) { + this.innerModel().withDeviceConfiguration(deviceConfiguration); + return this; + } + + public EdgeDeviceImpl withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java index 34a960cb551b..63be78666eb3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java @@ -22,10 +22,10 @@ public final class EdgeDevicesImpl implements EdgeDevices { private final EdgeDevicesClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public EdgeDevicesImpl(EdgeDevicesClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -59,25 +59,6 @@ public EdgeDevice get(String resourceUri, String edgeDeviceName) { } } - public EdgeDevice createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource) { - EdgeDeviceInner inner = this.serviceClient().createOrUpdate(resourceUri, edgeDeviceName, resource); - if (inner != null) { - return new EdgeDeviceImpl(inner, this.manager()); - } else { - return null; - } - } - - public EdgeDevice createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource, - Context context) { - EdgeDeviceInner inner = this.serviceClient().createOrUpdate(resourceUri, edgeDeviceName, resource, context); - if (inner != null) { - return new EdgeDeviceImpl(inner, this.manager()); - } else { - return null; - } - } - public void deleteByResourceGroup(String resourceUri, String edgeDeviceName) { this.serviceClient().delete(resourceUri, edgeDeviceName); } @@ -106,11 +87,79 @@ public ValidateResponse validate(String resourceUri, String edgeDeviceName, Vali } } + public EdgeDevice getById(String id) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String edgeDeviceName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "edgeDeviceName"); + if (edgeDeviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeDevices'.", id))); + } + return this.getWithResponse(resourceUri, edgeDeviceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String edgeDeviceName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "edgeDeviceName"); + if (edgeDeviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeDevices'.", id))); + } + return this.getWithResponse(resourceUri, edgeDeviceName, context); + } + + public void deleteById(String id) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String edgeDeviceName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "edgeDeviceName"); + if (edgeDeviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeDevices'.", id))); + } + this.delete(resourceUri, edgeDeviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String edgeDeviceName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}", "edgeDeviceName"); + if (edgeDeviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeDevices'.", id))); + } + this.delete(resourceUri, edgeDeviceName, context); + } + private EdgeDevicesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } + + public EdgeDeviceImpl define(String name) { + return new EdgeDeviceImpl(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 index 4e2708793046..a7a3358b0e97 100644 --- 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 @@ -21,7 +21,7 @@ public final class ExtensionImpl implements Extension, Extension.Definition, Extension.Update { private ExtensionInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -100,7 +100,7 @@ public ExtensionInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -135,7 +135,7 @@ public Extension create(Context context) { return this; } - ExtensionImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + ExtensionImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new ExtensionInner(); this.serviceManager = serviceManager; this.extensionName = name; @@ -161,7 +161,7 @@ public Extension apply(Context context) { } ExtensionImpl(ExtensionInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); 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 index 996d03e65744..14ae192f8d35 100644 --- 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 @@ -12,18 +12,18 @@ 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; import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; +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; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public ExtensionsImpl(ExtensionsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -186,7 +186,7 @@ private ExtensionsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/GalleryImagesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java new file mode 100644 index 000000000000..2f382e6026d8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java @@ -0,0 +1,255 @@ +// Copyright (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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryImageName = ResourceManagerUtils.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/GalleryImagesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsClientImpl.java new file mode 100644 index 000000000000..3017868aa26a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsClientImpl.java @@ -0,0 +1,1302 @@ +// Copyright (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.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 GalleryImagesOperationsClient. + */ +public final class GalleryImagesOperationsClientImpl implements GalleryImagesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GalleryImagesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of GalleryImagesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryImagesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(GalleryImagesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientGalleryImagesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientG") + public interface GalleryImagesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImagesUpdateRequest galleryImages, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages") + @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/galleryImages") + @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 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 gallery image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String galleryImageName) { + 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 (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.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, galleryImageName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String galleryImageName, 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 (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.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + galleryImageName, this.client.getApiVersion(), accept, 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String galleryImageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 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) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String galleryImageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryImageName, context).block(); + } + + /** + * 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 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) + public GalleryImagesInner getByResourceGroup(String resourceGroupName, String galleryImageName) { + return getByResourceGroupWithResponse(resourceGroupName, galleryImageName, Context.NONE).getValue(); + } + + /** + * 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 galleryImages 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 gallery images resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryImageName, GalleryImagesInner galleryImages) { + 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 (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName 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.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, galleryImageName, this.client.getApiVersion(), galleryImages, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 galleryImages 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 gallery images resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryImageName, GalleryImagesInner galleryImages, 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 (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName 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.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + galleryImageName, this.client.getApiVersion(), galleryImages, accept, 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 galleryImages 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 {@link PollerFlux} for polling of the gallery images resource definition. + */ + @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()); + } + + /** + * 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 galleryImages 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 {@link PollerFlux} for polling of the gallery images resource definition. + */ + @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); + } + + /** + * 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 galleryImages 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 {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImagesInner> beginCreateOrUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesInner galleryImages) { + return this.beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages).getSyncPoller(); + } + + /** + * 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 galleryImages 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 {@link SyncPoller} for polling of the gallery images resource definition. + */ + @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(); + } + + /** + * 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 galleryImages 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 gallery images resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String galleryImageName, + GalleryImagesInner galleryImages) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 galleryImages 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 gallery images resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String galleryImageName, + GalleryImagesInner galleryImages, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 galleryImages 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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImagesInner createOrUpdate(String resourceGroupName, String galleryImageName, + GalleryImagesInner galleryImages) { + return createOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages).block(); + } + + /** + * 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 galleryImages 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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImagesInner createOrUpdate(String resourceGroupName, String galleryImageName, + GalleryImagesInner galleryImages, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 galleryImageName) { + 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 (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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, galleryImageName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryImageName, + 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 (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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + galleryImageName, this.client.getApiVersion(), accept, 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 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 deleteAsync(String resourceGroupName, String galleryImageName) { + return beginDeleteAsync(resourceGroupName, galleryImageName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryImageName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryImageName, Context context) { + deleteAsync(resourceGroupName, galleryImageName, context).block(); + } + + /** + * 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 galleryImages 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 gallery images resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages) { + 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 (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName 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.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, galleryImageName, this.client.getApiVersion(), galleryImages, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 galleryImages 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 gallery images resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages, 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 (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName 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.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + galleryImageName, this.client.getApiVersion(), galleryImages, accept, 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 galleryImages 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 {@link PollerFlux} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryImagesInner> beginUpdateAsync(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryImagesInner.class, GalleryImagesInner.class, this.client.getContext()); + } + + /** + * 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 galleryImages 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 {@link PollerFlux} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryImagesInner> beginUpdateAsync(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, galleryImageName, galleryImages, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryImagesInner.class, GalleryImagesInner.class, 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 galleryImages 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 {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImagesInner> beginUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages) { + return this.beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages).getSyncPoller(); + } + + /** + * 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 galleryImages 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 {@link SyncPoller} for polling of the gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImagesInner> beginUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + return this.beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).getSyncPoller(); + } + + /** + * 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 galleryImages 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 gallery images resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages) { + return beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 galleryImages 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 gallery images resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages, Context context) { + return beginUpdateAsync(resourceGroupName, galleryImageName, galleryImages, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 galleryImages 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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImagesInner update(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages) { + return updateAsync(resourceGroupName, galleryImageName, galleryImages).block(); + } + + /** + * 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 galleryImages 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 gallery images resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImagesInner update(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages, Context context) { + return updateAsync(resourceGroupName, galleryImageName, galleryImages, context).block(); + } + + /** + * 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 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> 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 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 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> 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 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 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 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 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 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 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) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(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 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) + 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> 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 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 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> 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 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * 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 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listAllNextSinglePageAsync(nextLink, 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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 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) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> 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/GalleryImagesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsImpl.java new file mode 100644 index 000000000000..2531a8f0e31b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesOperationsImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + } + + public GalleryImages getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 000000000000..d0d7426dea02 --- /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.core.management.SystemData; +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.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GuestCredential credentials() { + return this.innerModel().credentials(); + } + + 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 000000000000..bb7a35b92923 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsClientImpl.java @@ -0,0 +1,657 @@ +// Copyright (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({ 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 000000000000..779ff1c1e6fa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsImpl.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.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 000000000000..532094ff63d9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsClientImpl.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 000000000000..96beac6fa09c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GuestAgentsOperationsImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.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/HciUpdateImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java index c0d5fef65ac6..2e2ce77e4e5a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java @@ -24,7 +24,7 @@ public final class HciUpdateImpl implements HciUpdate, HciUpdate.Definition, HciUpdate.Update { private HciUpdateInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -58,10 +58,6 @@ public String description() { return this.innerModel().description(); } - public String minSbeVersionRequired() { - return this.innerModel().minSbeVersionRequired(); - } - public State state() { return this.innerModel().state(); } @@ -165,7 +161,7 @@ public HciUpdateInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -197,7 +193,7 @@ public HciUpdate create(Context context) { return this; } - HciUpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + HciUpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new HciUpdateInner(); this.serviceManager = serviceManager; this.updateName = name; @@ -224,7 +220,7 @@ public HciUpdate apply(Context context) { } HciUpdateImpl(HciUpdateInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -276,11 +272,6 @@ public HciUpdateImpl withDescription(String description) { return this; } - public HciUpdateImpl withMinSbeVersionRequired(String minSbeVersionRequired) { - this.innerModel().withMinSbeVersionRequired(minSbeVersionRequired); - return this; - } - public HciUpdateImpl withState(State state) { this.innerModel().withState(state); return this; 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 000000000000..fbe629a1bab7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadataImpl.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.implementation; + +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 000000000000..541eea7c9b6d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasClientImpl.java @@ -0,0 +1,377 @@ +// Copyright (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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 000000000000..d99378a932d2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HybridIdentityMetadatasImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.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/LogicalNetworksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksImpl.java new file mode 100644 index 000000000000..a8f3d9bb491f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksImpl.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.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.LogicalNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworkStatus; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworks; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksUpdateRequest; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; +import com.azure.resourcemanager.azurestackhci.models.Subnet; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LogicalNetworksImpl implements LogicalNetworks, LogicalNetworks.Definition, LogicalNetworks.Update { + private LogicalNetworksInner 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 LogicalNetworkPropertiesDhcpOptions dhcpOptions() { + return this.innerModel().dhcpOptions(); + } + + 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 LogicalNetworkStatus 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 LogicalNetworksInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String logicalNetworkName; + + private LogicalNetworksUpdateRequest updateLogicalNetworks; + + public LogicalNetworksImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LogicalNetworks create() { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .createOrUpdate(resourceGroupName, logicalNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public LogicalNetworks create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .createOrUpdate(resourceGroupName, logicalNetworkName, this.innerModel(), context); + return this; + } + + LogicalNetworksImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { + this.innerObject = new LogicalNetworksInner(); + this.serviceManager = serviceManager; + this.logicalNetworkName = name; + } + + public LogicalNetworksImpl update() { + this.updateLogicalNetworks = new LogicalNetworksUpdateRequest(); + return this; + } + + public LogicalNetworks apply() { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .update(resourceGroupName, logicalNetworkName, updateLogicalNetworks, Context.NONE); + return this; + } + + public LogicalNetworks apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .update(resourceGroupName, logicalNetworkName, updateLogicalNetworks, context); + return this; + } + + LogicalNetworksImpl(LogicalNetworksInner innerObject, + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.logicalNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logicalNetworks"); + } + + public LogicalNetworks refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, Context.NONE) + .getValue(); + return this; + } + + public LogicalNetworks refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, context) + .getValue(); + return this; + } + + public LogicalNetworksImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LogicalNetworksImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LogicalNetworksImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateLogicalNetworks.withTags(tags); + return this; + } + } + + public LogicalNetworksImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public LogicalNetworksImpl withDhcpOptions(LogicalNetworkPropertiesDhcpOptions dhcpOptions) { + this.innerModel().withDhcpOptions(dhcpOptions); + return this; + } + + public LogicalNetworksImpl withSubnets(List subnets) { + this.innerModel().withSubnets(subnets); + return this; + } + + public LogicalNetworksImpl 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/LogicalNetworksOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksOperationsClientImpl.java new file mode 100644 index 000000000000..d00f1ef570c1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksOperationsClientImpl.java @@ -0,0 +1,1310 @@ +// Copyright (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.LogicalNetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.LogicalNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksListResult; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksUpdateRequest; +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 LogicalNetworksOperationsClient. + */ +public final class LogicalNetworksOperationsClientImpl implements LogicalNetworksOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogicalNetworksOperationsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of LogicalNetworksOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogicalNetworksOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(LogicalNetworksOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientLogicalNetworksOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientL") + public interface LogicalNetworksOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("logicalNetworkName") String logicalNetworkName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("logicalNetworkName") String logicalNetworkName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogicalNetworksInner logicalNetworks, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("logicalNetworkName") String logicalNetworkName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("logicalNetworkName") String logicalNetworkName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogicalNetworksUpdateRequest logicalNetworks, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks") + @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/logicalNetworks") + @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); + } + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String logicalNetworkName) { + 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, logicalNetworkName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String logicalNetworkName, 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName 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, + logicalNetworkName, this.client.getApiVersion(), accept, context); + } + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String logicalNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, logicalNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String logicalNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, logicalNetworkName, context).block(); + } + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworksInner getByResourceGroup(String resourceGroupName, String logicalNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, Context.NONE).getValue(); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String logicalNetworkName, LogicalNetworksInner logicalNetworks) { + 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + if (logicalNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworks is required and cannot be null.")); + } else { + logicalNetworks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, logicalNetworkName, this.client.getApiVersion(), logicalNetworks, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String logicalNetworkName, LogicalNetworksInner logicalNetworks, 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + if (logicalNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworks is required and cannot be null.")); + } else { + logicalNetworks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + logicalNetworkName, this.client.getApiVersion(), logicalNetworks, accept, context); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link PollerFlux} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogicalNetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, logicalNetworkName, logicalNetworks); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogicalNetworksInner.class, LogicalNetworksInner.class, this.client.getContext()); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link PollerFlux} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogicalNetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogicalNetworksInner.class, LogicalNetworksInner.class, context); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link SyncPoller} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogicalNetworksInner> + beginCreateOrUpdate(String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks) { + return this.beginCreateOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).getSyncPoller(); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link SyncPoller} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogicalNetworksInner> beginCreateOrUpdate( + String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks) { + return beginCreateOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworksInner createOrUpdate(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks) { + return createOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).block(); + } + + /** + * The operation to create or update a logical network. Please note some properties can be set only during logical + * network creation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworksInner createOrUpdate(String resourceGroupName, String logicalNetworkName, + LogicalNetworksInner logicalNetworks, Context context) { + return createOrUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context).block(); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String logicalNetworkName) { + 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, logicalNetworkName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String logicalNetworkName, 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName 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, + logicalNetworkName, this.client.getApiVersion(), accept, context); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String logicalNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, logicalNetworkName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String logicalNetworkName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, logicalNetworkName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String logicalNetworkName) { + return this.beginDeleteAsync(resourceGroupName, logicalNetworkName).getSyncPoller(); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String logicalNetworkName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, logicalNetworkName, context).getSyncPoller(); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String logicalNetworkName) { + return beginDeleteAsync(resourceGroupName, logicalNetworkName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String logicalNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, logicalNetworkName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String logicalNetworkName) { + deleteAsync(resourceGroupName, logicalNetworkName).block(); + } + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String logicalNetworkName, Context context) { + deleteAsync(resourceGroupName, logicalNetworkName, context).block(); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks) { + 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + if (logicalNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworks is required and cannot be null.")); + } else { + logicalNetworks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, logicalNetworkName, this.client.getApiVersion(), logicalNetworks, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks, 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 (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + if (logicalNetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworks is required and cannot be null.")); + } else { + logicalNetworks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + logicalNetworkName, this.client.getApiVersion(), logicalNetworks, accept, context); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link PollerFlux} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogicalNetworksInner> beginUpdateAsync( + String resourceGroupName, String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, logicalNetworkName, logicalNetworks); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogicalNetworksInner.class, LogicalNetworksInner.class, this.client.getContext()); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link PollerFlux} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogicalNetworksInner> beginUpdateAsync( + String resourceGroupName, String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogicalNetworksInner.class, LogicalNetworksInner.class, context); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link SyncPoller} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogicalNetworksInner> beginUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks) { + return this.beginUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).getSyncPoller(); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 {@link SyncPoller} for polling of the logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogicalNetworksInner> beginUpdate(String resourceGroupName, + String logicalNetworkName, LogicalNetworksUpdateRequest logicalNetworks, Context context) { + return this.beginUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context).getSyncPoller(); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks) { + return beginUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks, Context context) { + return beginUpdateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworksInner update(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks) { + return updateAsync(resourceGroupName, logicalNetworkName, logicalNetworks).block(); + } + + /** + * The operation to update a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical network. + * @param logicalNetworks The logicalNetworks 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 logical network resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworksInner update(String resourceGroupName, String logicalNetworkName, + LogicalNetworksUpdateRequest logicalNetworks, Context context) { + return updateAsync(resourceGroupName, logicalNetworkName, logicalNetworks, context).block(); + } + + /** + * Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical networks. + * + * @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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 ManagementException 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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical networks. + * + * @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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 ManagementException 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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical networks. + * + * @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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 ManagementException 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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/LogicalNetworksOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksOperationsImpl.java new file mode 100644 index 000000000000..52c9f50f0e37 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/LogicalNetworksOperationsImpl.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.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.LogicalNetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.LogicalNetworksInner; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworks; +import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksOperations; + +public final class LogicalNetworksOperationsImpl implements LogicalNetworksOperations { + private static final ClientLogger LOGGER = new ClientLogger(LogicalNetworksOperationsImpl.class); + + private final LogicalNetworksOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; + + public LogicalNetworksOperationsImpl(LogicalNetworksOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String logicalNetworkName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogicalNetworksImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogicalNetworks getByResourceGroup(String resourceGroupName, String logicalNetworkName) { + LogicalNetworksInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, logicalNetworkName); + if (inner != null) { + return new LogicalNetworksImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String logicalNetworkName) { + this.serviceClient().delete(resourceGroupName, logicalNetworkName); + } + + public void delete(String resourceGroupName, String logicalNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, logicalNetworkName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + } + + public LogicalNetworks getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 logicalNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "logicalNetworks"); + if (logicalNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicalNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 logicalNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "logicalNetworks"); + if (logicalNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicalNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 logicalNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "logicalNetworks"); + if (logicalNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicalNetworks'.", id))); + } + this.delete(resourceGroupName, logicalNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 logicalNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "logicalNetworks"); + if (logicalNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicalNetworks'.", id))); + } + this.delete(resourceGroupName, logicalNetworkName, context); + } + + private LogicalNetworksOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { + return this.serviceManager; + } + + public LogicalNetworksImpl define(String name) { + return new LogicalNetworksImpl(name, this.manager()); + } +} 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 000000000000..254d768dc7a5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesImpl.java @@ -0,0 +1,249 @@ +// Copyright (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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.marketplaceGalleryImageName + = ResourceManagerUtils.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/MarketplaceGalleryImagesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsClientImpl.java new file mode 100644 index 000000000000..2d75c7cc9410 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsClientImpl.java @@ -0,0 +1,1340 @@ +// Copyright (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.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 MarketplaceGalleryImagesOperationsClient. + */ +public final class MarketplaceGalleryImagesOperationsClientImpl implements MarketplaceGalleryImagesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MarketplaceGalleryImagesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of MarketplaceGalleryImagesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MarketplaceGalleryImagesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(MarketplaceGalleryImagesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientMarketplaceGalleryImagesOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientM") + public interface MarketplaceGalleryImagesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MarketplaceGalleryImagesInner marketplaceGalleryImages, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("marketplaceGalleryImageName") String marketplaceGalleryImageName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages") + @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/marketplaceGalleryImages") + @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 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName) { + 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, marketplaceGalleryImageName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName, 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 (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); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String marketplaceGalleryImageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, marketplaceGalleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String marketplaceGalleryImageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, context).block(); + } + + /** + * 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 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) + public MarketplaceGalleryImagesInner getByResourceGroup(String resourceGroupName, + String marketplaceGalleryImageName) { + return getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, Context.NONE).getValue(); + } + + /** + * 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 marketplaceGalleryImages 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 marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages) { + 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + if (marketplaceGalleryImages == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); + } else { + marketplaceGalleryImages.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, marketplaceGalleryImageName, this.client.getApiVersion(), marketplaceGalleryImages, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 marketplaceGalleryImages 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 marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages, 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + if (marketplaceGalleryImages == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); + } else { + marketplaceGalleryImages.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + marketplaceGalleryImageName, this.client.getApiVersion(), marketplaceGalleryImages, accept, context); + } + + /** + * 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 marketplaceGalleryImages 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 {@link PollerFlux} for polling of the marketplace gallery image resource definition. + */ + @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()); + } + + /** + * 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 marketplaceGalleryImages 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 {@link PollerFlux} for polling of the marketplace gallery image resource definition. + */ + @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); + } + + /** + * 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 marketplaceGalleryImages 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 {@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(); + } + + /** + * 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 marketplaceGalleryImages 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 {@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 marketplaceGalleryImages 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 marketplace gallery image resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages) { + return beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 marketplaceGalleryImages 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 marketplace gallery image resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 marketplaceGalleryImages 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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceGalleryImagesInner createOrUpdate(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages) { + return createOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).block(); + } + + /** + * 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 marketplaceGalleryImages 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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceGalleryImagesInner createOrUpdate(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, Context context) { + return createOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .block(); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName) { + 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, marketplaceGalleryImageName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName, 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 (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); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + marketplaceGalleryImageName, this.client.getApiVersion(), accept, context); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, marketplaceGalleryImageName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName) { + return this.beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName).getSyncPoller(); + } + + /** + * 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 ManagementException 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 marketplaceGalleryImageName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName, context).getSyncPoller(); + } + + /** + * 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 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 marketplaceGalleryImageName) { + return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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 marketplaceGalleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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 marketplaceGalleryImageName) { + deleteAsync(resourceGroupName, marketplaceGalleryImageName).block(); + } + + /** + * 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 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 marketplaceGalleryImageName, Context context) { + deleteAsync(resourceGroupName, marketplaceGalleryImageName, context).block(); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + if (marketplaceGalleryImages == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); + } else { + marketplaceGalleryImages.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, marketplaceGalleryImageName, this.client.getApiVersion(), marketplaceGalleryImages, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, + 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 (marketplaceGalleryImageName == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImageName is required and cannot be null.")); + } + if (marketplaceGalleryImages == null) { + return Mono.error( + new IllegalArgumentException("Parameter marketplaceGalleryImages is required and cannot be null.")); + } else { + marketplaceGalleryImages.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + marketplaceGalleryImageName, this.client.getApiVersion(), marketplaceGalleryImages, accept, context); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 {@link PollerFlux} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MarketplaceGalleryImagesInner.class, MarketplaceGalleryImagesInner.class, + this.client.getContext()); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 {@link PollerFlux} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, marketplaceGalleryImageName, + marketplaceGalleryImages, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MarketplaceGalleryImagesInner.class, MarketplaceGalleryImagesInner.class, + context); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 {@link SyncPoller} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return this.beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages) + .getSyncPoller(); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 {@link SyncPoller} for polling of the marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { + return this.beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .getSyncPoller(); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, + Context context) { + return beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceGalleryImagesInner update(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + return updateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).block(); + } + + /** + * The operation to update 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 marketplaceGalleryImages The marketplaceGalleryImages 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 marketplace gallery image resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceGalleryImagesInner update(String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { + return updateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context).block(); + } + + /** + * 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 ManagementException 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 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 ManagementException 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 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 ManagementException 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 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 ManagementException 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 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 ManagementException 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 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 ManagementException 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 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 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 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 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 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 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 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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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/MarketplaceGalleryImagesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsImpl.java new file mode 100644 index 000000000000..d631e6a55650 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/MarketplaceGalleryImagesOperationsImpl.java @@ -0,0 +1,150 @@ +// Copyright (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 ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + } + + public MarketplaceGalleryImages getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 000000000000..6c7a14df4b05 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = ResourceManagerUtils.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 000000000000..28a286ec4e39 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsClientImpl.java @@ -0,0 +1,1320 @@ +// Copyright (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({ 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 {@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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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 networkInterfaces 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 000000000000..da0070ede4c0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkInterfacesOperationsImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + } + + public NetworkInterfaces getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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/OfferImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java index 2b1ebff07b91..38806762a47c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java @@ -14,9 +14,9 @@ public final class OfferImpl implements Offer { private OfferInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; - OfferImpl(OfferInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + OfferImpl(OfferInner innerObject, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -66,7 +66,7 @@ public OfferInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/OffersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java index 7fb259cdce4c..acbc2001179a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java @@ -19,10 +19,10 @@ public final class OffersImpl implements Offers { private final OffersClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public OffersImpl(OffersClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -77,7 +77,7 @@ private OffersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/OperationListResultImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java index 27426092a831..b53007e8af05 100644 --- 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 @@ -13,10 +13,10 @@ public final class OperationListResultImpl implements OperationListResult { private OperationListResultInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; OperationListResultImpl(OperationListResultInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -38,7 +38,7 @@ public OperationListResultInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java index 55554d78e9b3..d00776155d3c 100644 --- 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 @@ -18,10 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -49,7 +49,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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 index f58a4556f483..e60fe3b1f065 100644 --- 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 @@ -11,10 +11,10 @@ public final class PasswordCredentialImpl implements PasswordCredential { private PasswordCredentialInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; PasswordCredentialImpl(PasswordCredentialInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public PasswordCredentialInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/PublisherImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java index 412046443c03..ac9f751d3abc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java @@ -11,10 +11,10 @@ public final class PublisherImpl implements Publisher { private PublisherInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; PublisherImpl(PublisherInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -43,7 +43,7 @@ public PublisherInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/PublishersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java index 633fca2b6424..e58dbf301bcf 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java @@ -19,10 +19,10 @@ public final class PublishersImpl implements Publishers { private final PublishersClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public PublishersImpl(PublishersClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -63,7 +63,7 @@ private PublishersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/SecuritySettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingImpl.java index 5d11a103fb30..63f986830d62 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingImpl.java @@ -15,7 +15,7 @@ public final class SecuritySettingImpl implements SecuritySetting, SecuritySetting.Definition, SecuritySetting.Update { private SecuritySettingInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -37,14 +37,6 @@ public ComplianceAssignmentType securedCoreComplianceAssignment() { return this.innerModel().securedCoreComplianceAssignment(); } - public ComplianceAssignmentType wdacComplianceAssignment() { - return this.innerModel().wdacComplianceAssignment(); - } - - public ComplianceAssignmentType smbEncryptionForIntraClusterTrafficComplianceAssignment() { - return this.innerModel().smbEncryptionForIntraClusterTrafficComplianceAssignment(); - } - public SecurityComplianceStatus securityComplianceStatus() { return this.innerModel().securityComplianceStatus(); } @@ -61,7 +53,7 @@ public SecuritySettingInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -91,7 +83,7 @@ public SecuritySetting create(Context context) { return this; } - SecuritySettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + SecuritySettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new SecuritySettingInner(); this.serviceManager = serviceManager; this.securitySettingsName = name; @@ -116,7 +108,7 @@ public SecuritySetting apply(Context context) { } SecuritySettingImpl(SecuritySettingInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -146,19 +138,6 @@ public SecuritySetting refresh(Context context) { return this; } - public SecuritySettingImpl withWdacComplianceAssignment(ComplianceAssignmentType wdacComplianceAssignment) { - this.innerModel().withWdacComplianceAssignment(wdacComplianceAssignment); - return this; - } - - public SecuritySettingImpl withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - ComplianceAssignmentType smbEncryptionForIntraClusterTrafficComplianceAssignment) { - this.innerModel() - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - smbEncryptionForIntraClusterTrafficComplianceAssignment); - return this; - } - public SecuritySettingImpl withProvisioningState(ProvisioningState provisioningState) { this.innerModel().withProvisioningState(provisioningState); return this; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.java index 82420589dfab..b9f57b195e16 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.java @@ -19,10 +19,10 @@ public final class SecuritySettingsImpl implements SecuritySettings { private final SecuritySettingsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public SecuritySettingsImpl(SecuritySettingsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -148,7 +148,7 @@ private SecuritySettingsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/SkuImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java index 8a2673751d6f..9c16c187313a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java @@ -14,9 +14,9 @@ public final class SkuImpl implements Sku { private SkuInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; - SkuImpl(SkuInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + SkuImpl(SkuInner innerObject, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -70,7 +70,7 @@ public SkuInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/SkusImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java index e5c630dd246a..d50a74dc44bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java @@ -19,10 +19,10 @@ public final class SkusImpl implements Skus { private final SkusClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public SkusImpl(SkusClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -67,7 +67,7 @@ private SkusClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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 000000000000..b74fa962407b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersImpl.java @@ -0,0 +1,197 @@ +// Copyright (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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageContainerName = ResourceManagerUtils.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 000000000000..7e7fda20147d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsClientImpl.java @@ -0,0 +1,1320 @@ +// Copyright (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({ 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 {@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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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 storageContainers 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 000000000000..2005ac39b532 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersOperationsImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + } + + public StorageContainers getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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/UpdateRunImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java index c2762b4da2e8..3a19b14e1a77 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java @@ -19,7 +19,7 @@ public final class UpdateRunImpl implements UpdateRun, UpdateRun.Definition, UpdateRun.Update { private UpdateRunInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public String id() { return this.innerModel().id(); @@ -89,10 +89,6 @@ public OffsetDateTime lastUpdatedTimeUtc() { return this.innerModel().lastUpdatedTimeUtc(); } - public String expectedExecutionTime() { - return this.innerModel().expectedExecutionTime(); - } - public List steps() { List inner = this.innerModel().steps(); if (inner != null) { @@ -118,7 +114,7 @@ public UpdateRunInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + private com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager() { return this.serviceManager; } @@ -153,7 +149,7 @@ public UpdateRun create(Context context) { return this; } - UpdateRunImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + UpdateRunImpl(String name, com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = new UpdateRunInner(); this.serviceManager = serviceManager; this.updateRunName = name; @@ -180,7 +176,7 @@ public UpdateRun apply(Context context) { } UpdateRunImpl(UpdateRunInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -270,11 +266,6 @@ public UpdateRunImpl withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { return this; } - public UpdateRunImpl withExpectedExecutionTime(String expectedExecutionTime) { - this.innerModel().withExpectedExecutionTime(expectedExecutionTime); - return this; - } - public UpdateRunImpl withSteps(List steps) { this.innerModel().withSteps(steps); return this; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java index b096203fef65..049104583d3b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java @@ -19,10 +19,10 @@ public final class UpdateRunsImpl implements UpdateRuns { private final UpdateRunsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public UpdateRunsImpl(UpdateRunsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -169,7 +169,7 @@ private UpdateRunsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/UpdateSummariesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java index a557121ba623..94ff9b90c21e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java @@ -19,10 +19,10 @@ public final class UpdateSummariesImpl implements UpdateSummaries { private UpdateSummariesInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; UpdateSummariesImpl(UpdateSummariesInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -55,10 +55,6 @@ public String oemFamily() { return this.innerModel().oemFamily(); } - public String currentOemVersion() { - return this.innerModel().currentOemVersion(); - } - public String hardwareModel() { return this.innerModel().hardwareModel(); } @@ -76,10 +72,6 @@ public String currentVersion() { return this.innerModel().currentVersion(); } - public String currentSbeVersion() { - return this.innerModel().currentSbeVersion(); - } - public OffsetDateTime lastUpdated() { return this.innerModel().lastUpdated(); } @@ -113,7 +105,7 @@ public UpdateSummariesInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/UpdateSummariesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java index 5645597784d9..f22c2ebe054d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java @@ -19,10 +19,10 @@ public final class UpdateSummariesOperationsImpl implements UpdateSummariesOpera private final UpdateSummariesOperationsClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public UpdateSummariesOperationsImpl(UpdateSummariesOperationsClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -91,7 +91,7 @@ private UpdateSummariesOperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/UpdatesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java index 1a84ed0d2274..f5e6a7d0f321 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java @@ -19,10 +19,10 @@ public final class UpdatesImpl implements Updates { private final UpdatesClient innerClient; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; public UpdatesImpl(UpdatesClient innerClient, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -154,7 +154,7 @@ private UpdatesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/ValidateResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ValidateResponseImpl.java index f17ea09f0a9d..db618504239e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ValidateResponseImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ValidateResponseImpl.java @@ -10,10 +10,10 @@ public final class ValidateResponseImpl implements ValidateResponse { private ValidateResponseInner innerObject; - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + private final com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager; ValidateResponseImpl(ValidateResponseInner innerObject, - com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -26,7 +26,7 @@ public ValidateResponseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + 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/VirtualHardDisksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java new file mode 100644 index 000000000000..0fd538fdb680 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java @@ -0,0 +1,262 @@ +// Copyright (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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHardDiskName = ResourceManagerUtils.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 000000000000..c6cf8acc8123 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsClientImpl.java @@ -0,0 +1,1311 @@ +// Copyright (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({ 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 {@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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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 virtualHardDisks 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 000000000000..19d4a4bde6b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksOperationsImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + } + + public VirtualHardDisks getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 000000000000..b5c425d6497b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstanceImpl.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.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.HttpProxyConfiguration; +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 HttpProxyConfiguration httpProxyConfig() { + return this.innerModel().httpProxyConfig(); + } + + 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 000000000000..c7dc546cae7f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesClientImpl.java @@ -0,0 +1,1609 @@ +// Copyright (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({ 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 {@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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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 virtualMachineInstance 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 000000000000..30cb9237378f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualMachineInstancesImpl.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.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.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/models/AccessLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AccessLevel.java deleted file mode 100644 index 866279b88a5f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AccessLevel.java +++ /dev/null @@ -1,51 +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 java.util.Collection; - -/** - * Remote Support Access Level. - */ -public final class AccessLevel extends ExpandableStringEnum { - /** - * Static value Diagnostics for AccessLevel. - */ - public static final AccessLevel DIAGNOSTICS = fromString("Diagnostics"); - - /** - * Static value DiagnosticsAndRepair for AccessLevel. - */ - public static final AccessLevel DIAGNOSTICS_AND_REPAIR = fromString("DiagnosticsAndRepair"); - - /** - * Creates a new instance of AccessLevel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AccessLevel() { - } - - /** - * Creates or finds a AccessLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding AccessLevel. - */ - public static AccessLevel fromString(String name) { - return fromString(name, AccessLevel.class); - } - - /** - * Gets known AccessLevel values. - * - * @return known AccessLevel values. - */ - public static Collection values() { - return values(AccessLevel.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingAdapterPropertyOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.java similarity index 71% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingAdapterPropertyOverrides.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.java index e906f7950cfe..e6a5362e80bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingAdapterPropertyOverrides.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.java @@ -15,8 +15,7 @@ * The AdapterPropertyOverrides of a cluster. */ @Fluent -public final class DeploymentSettingAdapterPropertyOverrides - implements JsonSerializable { +public final class AdapterPropertyOverrides implements JsonSerializable { /* * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM * validation. @@ -36,9 +35,9 @@ public final class DeploymentSettingAdapterPropertyOverrides private String networkDirectTechnology; /** - * Creates an instance of DeploymentSettingAdapterPropertyOverrides class. + * Creates an instance of AdapterPropertyOverrides class. */ - public DeploymentSettingAdapterPropertyOverrides() { + public AdapterPropertyOverrides() { } /** @@ -56,9 +55,9 @@ public String jumboPacket() { * this parameter without OEM validation. * * @param jumboPacket the jumboPacket value to set. - * @return the DeploymentSettingAdapterPropertyOverrides object itself. + * @return the AdapterPropertyOverrides object itself. */ - public DeploymentSettingAdapterPropertyOverrides withJumboPacket(String jumboPacket) { + public AdapterPropertyOverrides withJumboPacket(String jumboPacket) { this.jumboPacket = jumboPacket; return this; } @@ -78,9 +77,9 @@ public String networkDirect() { * this parameter without OEM validation. * * @param networkDirect the networkDirect value to set. - * @return the DeploymentSettingAdapterPropertyOverrides object itself. + * @return the AdapterPropertyOverrides object itself. */ - public DeploymentSettingAdapterPropertyOverrides withNetworkDirect(String networkDirect) { + public AdapterPropertyOverrides withNetworkDirect(String networkDirect) { this.networkDirect = networkDirect; return this; } @@ -100,9 +99,9 @@ public String networkDirectTechnology() { * not modify this parameter without OEM validation. Expected values are 'iWARP', 'RoCEv2', 'RoCE'. * * @param networkDirectTechnology the networkDirectTechnology value to set. - * @return the DeploymentSettingAdapterPropertyOverrides object itself. + * @return the AdapterPropertyOverrides object itself. */ - public DeploymentSettingAdapterPropertyOverrides withNetworkDirectTechnology(String networkDirectTechnology) { + public AdapterPropertyOverrides withNetworkDirectTechnology(String networkDirectTechnology) { this.networkDirectTechnology = networkDirectTechnology; return this; } @@ -128,33 +127,32 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of DeploymentSettingAdapterPropertyOverrides from the JsonReader. + * Reads an instance of AdapterPropertyOverrides from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingAdapterPropertyOverrides if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingAdapterPropertyOverrides. + * @return An instance of AdapterPropertyOverrides if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdapterPropertyOverrides. */ - public static DeploymentSettingAdapterPropertyOverrides fromJson(JsonReader jsonReader) throws IOException { + public static AdapterPropertyOverrides fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - DeploymentSettingAdapterPropertyOverrides deserializedDeploymentSettingAdapterPropertyOverrides - = new DeploymentSettingAdapterPropertyOverrides(); + AdapterPropertyOverrides deserializedAdapterPropertyOverrides = new AdapterPropertyOverrides(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("jumboPacket".equals(fieldName)) { - deserializedDeploymentSettingAdapterPropertyOverrides.jumboPacket = reader.getString(); + deserializedAdapterPropertyOverrides.jumboPacket = reader.getString(); } else if ("networkDirect".equals(fieldName)) { - deserializedDeploymentSettingAdapterPropertyOverrides.networkDirect = reader.getString(); + deserializedAdapterPropertyOverrides.networkDirect = reader.getString(); } else if ("networkDirectTechnology".equals(fieldName)) { - deserializedDeploymentSettingAdapterPropertyOverrides.networkDirectTechnology = reader.getString(); + deserializedAdapterPropertyOverrides.networkDirectTechnology = reader.getString(); } else { reader.skipChildren(); } } - return deserializedDeploymentSettingAdapterPropertyOverrides; + return deserializedAdapterPropertyOverrides; }); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcExtensionState.java deleted file mode 100644 index ce07e9c36823..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcExtensionState.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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Arc extension installation state. - */ -public final class ArcExtensionState extends ExpandableStringEnum { - /** - * Static value NotSpecified for ArcExtensionState. - */ - public static final ArcExtensionState NOT_SPECIFIED = fromString("NotSpecified"); - - /** - * Static value Succeeded for ArcExtensionState. - */ - public static final ArcExtensionState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for ArcExtensionState. - */ - public static final ArcExtensionState FAILED = fromString("Failed"); - - /** - * Static value Canceled for ArcExtensionState. - */ - public static final ArcExtensionState CANCELED = fromString("Canceled"); - - /** - * Static value Accepted for ArcExtensionState. - */ - public static final ArcExtensionState ACCEPTED = fromString("Accepted"); - - /** - * Static value Creating for ArcExtensionState. - */ - public static final ArcExtensionState CREATING = fromString("Creating"); - - /** - * Static value Updating for ArcExtensionState. - */ - public static final ArcExtensionState UPDATING = fromString("Updating"); - - /** - * Static value Moving for ArcExtensionState. - */ - public static final ArcExtensionState MOVING = fromString("Moving"); - - /** - * Static value Deleting for ArcExtensionState. - */ - public static final ArcExtensionState DELETING = fromString("Deleting"); - - /** - * Static value Deleted for ArcExtensionState. - */ - public static final ArcExtensionState DELETED = fromString("Deleted"); - - /** - * Creates a new instance of ArcExtensionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ArcExtensionState() { - } - - /** - * Creates or finds a ArcExtensionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ArcExtensionState. - */ - public static ArcExtensionState fromString(String name) { - return fromString(name, ArcExtensionState.class); - } - - /** - * Gets known ArcExtensionState values. - * - * @return known ArcExtensionState values. - */ - public static Collection values() { - return values(ArcExtensionState.class); - } -} 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 000000000000..856f70e84c85 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CloudInitDataSource.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.util.ExpandableStringEnum; +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. + */ + 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 index 916dc730f58e..bbe497995eb2 100644 --- 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 @@ -162,20 +162,6 @@ public interface Cluster { */ SoftwareAssuranceProperties softwareAssuranceProperties(); - /** - * Gets the logCollectionProperties property: Log Collection properties of the cluster. - * - * @return the logCollectionProperties value. - */ - LogCollectionProperties logCollectionProperties(); - - /** - * Gets the remoteSupportProperties property: RemoteSupport properties of the cluster. - * - * @return the remoteSupportProperties value. - */ - RemoteSupportProperties remoteSupportProperties(); - /** * Gets the desiredProperties property: Desired properties of the cluster. * @@ -334,8 +320,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithTyp DefinitionStages.WithUserAssignedIdentities, DefinitionStages.WithCloudManagementEndpoint, DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, DefinitionStages.WithAadApplicationObjectId, DefinitionStages.WithAadServicePrincipalObjectId, - DefinitionStages.WithSoftwareAssuranceProperties, DefinitionStages.WithLogCollectionProperties, - DefinitionStages.WithRemoteSupportProperties, DefinitionStages.WithDesiredProperties { + DefinitionStages.WithSoftwareAssuranceProperties, DefinitionStages.WithDesiredProperties { /** * Executes the create request. * @@ -478,32 +463,6 @@ interface WithSoftwareAssuranceProperties { WithCreate withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties); } - /** - * The stage of the Cluster definition allowing to specify logCollectionProperties. - */ - interface WithLogCollectionProperties { - /** - * Specifies the logCollectionProperties property: Log Collection properties of the cluster.. - * - * @param logCollectionProperties Log Collection properties of the cluster. - * @return the next definition stage. - */ - WithCreate withLogCollectionProperties(LogCollectionProperties logCollectionProperties); - } - - /** - * The stage of the Cluster definition allowing to specify remoteSupportProperties. - */ - interface WithRemoteSupportProperties { - /** - * Specifies the remoteSupportProperties property: RemoteSupport properties of the cluster.. - * - * @param remoteSupportProperties RemoteSupport properties of the cluster. - * @return the next definition stage. - */ - WithCreate withRemoteSupportProperties(RemoteSupportProperties remoteSupportProperties); - } - /** * The stage of the Cluster definition allowing to specify desiredProperties. */ @@ -730,50 +689,4 @@ interface WithDesiredProperties { */ Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); - - /** - * Trigger Log Collection on a cluster. - * - * @param logCollectionRequest Trigger Log Collection Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Cluster triggerLogCollection(LogCollectionRequest logCollectionRequest); - - /** - * Trigger Log Collection on a cluster. - * - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - Cluster triggerLogCollection(LogCollectionRequest logCollectionRequest, Context context); - - /** - * Configure RemoteSupport on a cluster. - * - * @param remoteSupportRequest Configure Remote Support Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Cluster configureRemoteSupport(RemoteSupportRequest remoteSupportRequest); - - /** - * Configure RemoteSupport on a cluster. - * - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - Cluster configureRemoteSupport(RemoteSupportRequest remoteSupportRequest, Context context); } 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/Clusters.java index 2850e30313cf..401bc48a9273 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/Clusters.java @@ -184,64 +184,6 @@ Cluster extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterN Cluster extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Cluster triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest); - - /** - * Trigger Log Collection on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param logCollectionRequest Trigger Log Collection 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 cluster details. - */ - Cluster triggerLogCollection(String resourceGroupName, String clusterName, - LogCollectionRequest logCollectionRequest, Context context); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support Request Payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Cluster configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest); - - /** - * Configure RemoteSupport on a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param remoteSupportRequest Configure Remote Support 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 cluster details. - */ - Cluster configureRemoteSupport(String resourceGroupName, String clusterName, - RemoteSupportRequest remoteSupportRequest, Context context); - /** * Get HCI cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentData.java index 542a8a634388..411318496004 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentData.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentData.java @@ -60,12 +60,7 @@ public final class DeploymentData implements JsonSerializable { /* * HostNetwork config to deploy AzureStackHCI Cluster. */ - private DeploymentSettingHostNetwork hostNetwork; - - /* - * SDN Integration config to deploy AzureStackHCI Cluster. - */ - private SdnIntegration sdnIntegration; + private HostNetwork hostNetwork; /* * The path to the Active Directory Organizational Unit container object prepared for the deployment. @@ -73,16 +68,10 @@ public final class DeploymentData implements JsonSerializable { private String adouPath; /* - * Azure keyvault endpoint. This property is deprecated from 2023-12-01-preview. Please use secrets property - * instead. + * The URI to the keyvault / secret store. */ private String secretsLocation; - /* - * secrets used for cloud deployment. - */ - private List secrets; - /* * OptionalServices config to deploy AzureStackHCI Cluster. */ @@ -259,7 +248,7 @@ public DeploymentData withPhysicalNodes(List physicalNodes) { * * @return the hostNetwork value. */ - public DeploymentSettingHostNetwork hostNetwork() { + public HostNetwork hostNetwork() { return this.hostNetwork; } @@ -269,31 +258,11 @@ public DeploymentSettingHostNetwork hostNetwork() { * @param hostNetwork the hostNetwork value to set. * @return the DeploymentData object itself. */ - public DeploymentData withHostNetwork(DeploymentSettingHostNetwork hostNetwork) { + public DeploymentData withHostNetwork(HostNetwork hostNetwork) { this.hostNetwork = hostNetwork; return this; } - /** - * Get the sdnIntegration property: SDN Integration config to deploy AzureStackHCI Cluster. - * - * @return the sdnIntegration value. - */ - public SdnIntegration sdnIntegration() { - return this.sdnIntegration; - } - - /** - * Set the sdnIntegration property: SDN Integration config to deploy AzureStackHCI Cluster. - * - * @param sdnIntegration the sdnIntegration value to set. - * @return the DeploymentData object itself. - */ - public DeploymentData withSdnIntegration(SdnIntegration sdnIntegration) { - this.sdnIntegration = sdnIntegration; - return this; - } - /** * Get the adouPath property: The path to the Active Directory Organizational Unit container object prepared for the * deployment. @@ -317,8 +286,7 @@ public DeploymentData withAdouPath(String adouPath) { } /** - * Get the secretsLocation property: Azure keyvault endpoint. This property is deprecated from 2023-12-01-preview. - * Please use secrets property instead. + * Get the secretsLocation property: The URI to the keyvault / secret store. * * @return the secretsLocation value. */ @@ -327,8 +295,7 @@ public String secretsLocation() { } /** - * Set the secretsLocation property: Azure keyvault endpoint. This property is deprecated from 2023-12-01-preview. - * Please use secrets property instead. + * Set the secretsLocation property: The URI to the keyvault / secret store. * * @param secretsLocation the secretsLocation value to set. * @return the DeploymentData object itself. @@ -338,26 +305,6 @@ public DeploymentData withSecretsLocation(String secretsLocation) { return this; } - /** - * Get the secrets property: secrets used for cloud deployment. - * - * @return the secrets value. - */ - public List secrets() { - return this.secrets; - } - - /** - * Set the secrets property: secrets used for cloud deployment. - * - * @param secrets the secrets value to set. - * @return the DeploymentData object itself. - */ - public DeploymentData withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - /** * Get the optionalServices property: OptionalServices config to deploy AzureStackHCI Cluster. * @@ -405,12 +352,6 @@ public void validate() { if (hostNetwork() != null) { hostNetwork().validate(); } - if (sdnIntegration() != null) { - sdnIntegration().validate(); - } - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } if (optionalServices() != null) { optionalServices().validate(); } @@ -432,10 +373,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("physicalNodes", this.physicalNodes, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("hostNetwork", this.hostNetwork); - jsonWriter.writeJsonField("sdnIntegration", this.sdnIntegration); jsonWriter.writeStringField("adouPath", this.adouPath); jsonWriter.writeStringField("secretsLocation", this.secretsLocation); - jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("optionalServices", this.optionalServices); return jsonWriter.writeEndObject(); } @@ -475,17 +414,11 @@ public static DeploymentData fromJson(JsonReader jsonReader) throws IOException List physicalNodes = reader.readArray(reader1 -> PhysicalNodes.fromJson(reader1)); deserializedDeploymentData.physicalNodes = physicalNodes; } else if ("hostNetwork".equals(fieldName)) { - deserializedDeploymentData.hostNetwork = DeploymentSettingHostNetwork.fromJson(reader); - } else if ("sdnIntegration".equals(fieldName)) { - deserializedDeploymentData.sdnIntegration = SdnIntegration.fromJson(reader); + deserializedDeploymentData.hostNetwork = HostNetwork.fromJson(reader); } else if ("adouPath".equals(fieldName)) { deserializedDeploymentData.adouPath = reader.getString(); } else if ("secretsLocation".equals(fieldName)) { deserializedDeploymentData.secretsLocation = reader.getString(); - } else if ("secrets".equals(fieldName)) { - List secrets - = reader.readArray(reader1 -> EceDeploymentSecrets.fromJson(reader1)); - deserializedDeploymentData.secrets = secrets; } else if ("optionalServices".equals(fieldName)) { deserializedDeploymentData.optionalServices = OptionalServices.fromJson(reader); } else { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentMode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentMode.java index 16a9b1d81720..d1836b4c1f9f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentMode.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentMode.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The deployment mode of EnterpriseCloudEngine(ECE) action for a cluster. + * The deployment mode for cluster deployment. */ public final class DeploymentMode extends ExpandableStringEnum { /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSetting.java index 7604f9b90c2d..1d79e36374ea 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSetting.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSetting.java @@ -62,13 +62,6 @@ public interface DeploymentSetting { */ DeploymentMode deploymentMode(); - /** - * Gets the operationType property: The intended operation for a cluster. - * - * @return the operationType value. - */ - OperationType operationType(); - /** * Gets the deploymentConfiguration property: Scale units will contains list of deployment data. * @@ -81,7 +74,7 @@ public interface DeploymentSetting { * * @return the reportedProperties value. */ - EceReportedProperties reportedProperties(); + ReportedProperties reportedProperties(); /** * Gets the name of the resource group. @@ -132,8 +125,8 @@ interface WithParentResource { * The stage of the DeploymentSetting 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.WithArcNodeResourceIds, DefinitionStages.WithDeploymentMode, - DefinitionStages.WithOperationType, DefinitionStages.WithDeploymentConfiguration { + interface WithCreate extends DefinitionStages.WithProvisioningState, DefinitionStages.WithArcNodeResourceIds, + DefinitionStages.WithDeploymentMode, DefinitionStages.WithDeploymentConfiguration { /** * Executes the create request. * @@ -150,6 +143,19 @@ interface WithCreate extends DefinitionStages.WithArcNodeResourceIds, Definition DeploymentSetting create(Context context); } + /** + * The stage of the DeploymentSetting definition allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: DeploymentSetting provisioning state. + * + * @param provisioningState DeploymentSetting provisioning state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + /** * The stage of the DeploymentSetting definition allowing to specify arcNodeResourceIds. */ @@ -176,19 +182,6 @@ interface WithDeploymentMode { WithCreate withDeploymentMode(DeploymentMode deploymentMode); } - /** - * The stage of the DeploymentSetting definition allowing to specify operationType. - */ - interface WithOperationType { - /** - * Specifies the operationType property: The intended operation for a cluster.. - * - * @param operationType The intended operation for a cluster. - * @return the next definition stage. - */ - WithCreate withOperationType(OperationType operationType); - } - /** * The stage of the DeploymentSetting definition allowing to specify deploymentConfiguration. */ @@ -213,8 +206,8 @@ interface WithDeploymentConfiguration { /** * The template for DeploymentSetting update. */ - interface Update extends UpdateStages.WithArcNodeResourceIds, UpdateStages.WithDeploymentMode, - UpdateStages.WithOperationType, UpdateStages.WithDeploymentConfiguration { + interface Update extends UpdateStages.WithProvisioningState, UpdateStages.WithArcNodeResourceIds, + UpdateStages.WithDeploymentMode, UpdateStages.WithDeploymentConfiguration { /** * Executes the update request. * @@ -235,6 +228,19 @@ interface Update extends UpdateStages.WithArcNodeResourceIds, UpdateStages.WithD * The DeploymentSetting update stages. */ interface UpdateStages { + /** + * The stage of the DeploymentSetting update allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: DeploymentSetting provisioning state. + * + * @param provisioningState DeploymentSetting provisioning state. + * @return the next definition stage. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + /** * The stage of the DeploymentSetting update allowing to specify arcNodeResourceIds. */ @@ -261,19 +267,6 @@ interface WithDeploymentMode { Update withDeploymentMode(DeploymentMode deploymentMode); } - /** - * The stage of the DeploymentSetting update allowing to specify operationType. - */ - interface WithOperationType { - /** - * Specifies the operationType property: The intended operation for a cluster.. - * - * @param operationType The intended operation for a cluster. - * @return the next definition stage. - */ - Update withOperationType(OperationType operationType); - } - /** * The stage of the DeploymentSetting update allowing to specify deploymentConfiguration. */ diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageAdapterIpInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageAdapterIpInfo.java deleted file mode 100644 index dc10edec4c2e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageAdapterIpInfo.java +++ /dev/null @@ -1,155 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The StorageAdapter physical nodes of a cluster. - */ -@Fluent -public final class DeploymentSettingStorageAdapterIpInfo - implements JsonSerializable { - /* - * storage adapter physical node name. - */ - private String physicalNode; - - /* - * The IPv4 address assigned to each storage adapter physical node on your Azure Stack HCI cluster. - */ - private String ipv4Address; - - /* - * The SubnetMask address assigned to each storage adapter physical node on your Azure Stack HCI cluster. - */ - private String subnetMask; - - /** - * Creates an instance of DeploymentSettingStorageAdapterIpInfo class. - */ - public DeploymentSettingStorageAdapterIpInfo() { - } - - /** - * Get the physicalNode property: storage adapter physical node name. - * - * @return the physicalNode value. - */ - public String physicalNode() { - return this.physicalNode; - } - - /** - * Set the physicalNode property: storage adapter physical node name. - * - * @param physicalNode the physicalNode value to set. - * @return the DeploymentSettingStorageAdapterIpInfo object itself. - */ - public DeploymentSettingStorageAdapterIpInfo withPhysicalNode(String physicalNode) { - this.physicalNode = physicalNode; - return this; - } - - /** - * Get the ipv4Address property: The IPv4 address assigned to each storage adapter physical node on your Azure Stack - * HCI cluster. - * - * @return the ipv4Address value. - */ - public String ipv4Address() { - return this.ipv4Address; - } - - /** - * Set the ipv4Address property: The IPv4 address assigned to each storage adapter physical node on your Azure Stack - * HCI cluster. - * - * @param ipv4Address the ipv4Address value to set. - * @return the DeploymentSettingStorageAdapterIpInfo object itself. - */ - public DeploymentSettingStorageAdapterIpInfo withIpv4Address(String ipv4Address) { - this.ipv4Address = ipv4Address; - return this; - } - - /** - * Get the subnetMask property: The SubnetMask address assigned to each storage adapter physical node on your Azure - * Stack HCI cluster. - * - * @return the subnetMask value. - */ - public String subnetMask() { - return this.subnetMask; - } - - /** - * Set the subnetMask property: The SubnetMask address assigned to each storage adapter physical node on your Azure - * Stack HCI cluster. - * - * @param subnetMask the subnetMask value to set. - * @return the DeploymentSettingStorageAdapterIpInfo object itself. - */ - public DeploymentSettingStorageAdapterIpInfo withSubnetMask(String subnetMask) { - this.subnetMask = subnetMask; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("physicalNode", this.physicalNode); - jsonWriter.writeStringField("ipv4Address", this.ipv4Address); - jsonWriter.writeStringField("subnetMask", this.subnetMask); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentSettingStorageAdapterIpInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingStorageAdapterIpInfo if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingStorageAdapterIpInfo. - */ - public static DeploymentSettingStorageAdapterIpInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentSettingStorageAdapterIpInfo deserializedDeploymentSettingStorageAdapterIpInfo - = new DeploymentSettingStorageAdapterIpInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("physicalNode".equals(fieldName)) { - deserializedDeploymentSettingStorageAdapterIpInfo.physicalNode = reader.getString(); - } else if ("ipv4Address".equals(fieldName)) { - deserializedDeploymentSettingStorageAdapterIpInfo.ipv4Address = reader.getString(); - } else if ("subnetMask".equals(fieldName)) { - deserializedDeploymentSettingStorageAdapterIpInfo.subnetMask = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentSettingStorageAdapterIpInfo; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceActionStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.java similarity index 69% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceActionStatus.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.java index 312a18a55dcd..ff99baae4b9e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceActionStatus.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.java @@ -13,12 +13,12 @@ import java.util.List; /** - * The ECE action plan deployment status for AzureStackHCI Cluster. + * The DeploymentStatus of AzureStackHCI Cluster. */ @Immutable -public final class EceActionStatus implements JsonSerializable { +public final class DeploymentStatus implements JsonSerializable { /* - * Status of ECE action AzureStackHCI Cluster Deployment. + * Status of AzureStackHCI Cluster Deployment. */ private String status; @@ -28,13 +28,13 @@ public final class EceActionStatus implements JsonSerializable private List steps; /** - * Creates an instance of EceActionStatus class. + * Creates an instance of DeploymentStatus class. */ - public EceActionStatus() { + public DeploymentStatus() { } /** - * Get the status property: Status of ECE action AzureStackHCI Cluster Deployment. + * Get the status property: Status of AzureStackHCI Cluster Deployment. * * @return the status value. */ @@ -72,31 +72,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of EceActionStatus from the JsonReader. + * Reads an instance of DeploymentStatus from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of EceActionStatus if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of DeploymentStatus if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IOException If an error occurs while reading the EceActionStatus. + * @throws IOException If an error occurs while reading the DeploymentStatus. */ - public static EceActionStatus fromJson(JsonReader jsonReader) throws IOException { + public static DeploymentStatus fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - EceActionStatus deserializedEceActionStatus = new EceActionStatus(); + DeploymentStatus deserializedDeploymentStatus = new DeploymentStatus(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("status".equals(fieldName)) { - deserializedEceActionStatus.status = reader.getString(); + deserializedDeploymentStatus.status = reader.getString(); } else if ("steps".equals(fieldName)) { List steps = reader.readArray(reader1 -> DeploymentStep.fromJson(reader1)); - deserializedEceActionStatus.steps = steps; + deserializedDeploymentStatus.steps = steps; } else { reader.skipChildren(); } } - return deserializedEceActionStatus; + return deserializedDeploymentStatus; }); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceConfiguration.java index 7d16e34e96ca..416cbb33b522 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceConfiguration.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceConfiguration.java @@ -13,7 +13,7 @@ import java.util.List; /** - * The device Configuration for edge device. + * The device Configuration of a device. */ @Fluent public final class DeviceConfiguration implements JsonSerializable { @@ -23,7 +23,7 @@ public final class DeviceConfiguration implements JsonSerializable nicDetails; /* - * Device metadata details. + * device metadata details. */ private String deviceMetadata; @@ -54,7 +54,7 @@ public DeviceConfiguration withNicDetails(List nicDetails) { } /** - * Get the deviceMetadata property: Device metadata details. + * Get the deviceMetadata property: device metadata details. * * @return the deviceMetadata value. */ @@ -63,7 +63,7 @@ public String deviceMetadata() { } /** - * Set the deviceMetadata property: Device metadata details. + * Set the deviceMetadata property: device metadata details. * * @param deviceMetadata the deviceMetadata value to set. * @return the DeviceConfiguration object itself. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceKind.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceKind.java deleted file mode 100644 index abac8012b799..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceKind.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.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Edge device kind. - */ -public final class DeviceKind extends ExpandableStringEnum { - /** - * Static value HCI for DeviceKind. - */ - public static final DeviceKind HCI = fromString("HCI"); - - /** - * Creates a new instance of DeviceKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeviceKind() { - } - - /** - * Creates or finds a DeviceKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceKind. - */ - public static DeviceKind fromString(String name) { - return fromString(name, DeviceKind.class); - } - - /** - * Gets known DeviceKind values. - * - * @return known DeviceKind values. - */ - public static Collection values() { - return values(DeviceKind.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceState.java deleted file mode 100644 index d44e61e86584..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceState.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The edge device state. - */ -public final class DeviceState extends ExpandableStringEnum { - /** - * Static value NotSpecified for DeviceState. - */ - public static final DeviceState NOT_SPECIFIED = fromString("NotSpecified"); - - /** - * Static value Connected for DeviceState. - */ - public static final DeviceState CONNECTED = fromString("Connected"); - - /** - * Static value Disconnected for DeviceState. - */ - public static final DeviceState DISCONNECTED = fromString("Disconnected"); - - /** - * Static value Repairing for DeviceState. - */ - public static final DeviceState REPAIRING = fromString("Repairing"); - - /** - * Static value Draining for DeviceState. - */ - public static final DeviceState DRAINING = fromString("Draining"); - - /** - * Static value InMaintenance for DeviceState. - */ - public static final DeviceState IN_MAINTENANCE = fromString("InMaintenance"); - - /** - * Static value Resuming for DeviceState. - */ - public static final DeviceState RESUMING = fromString("Resuming"); - - /** - * Static value Processing for DeviceState. - */ - public static final DeviceState PROCESSING = fromString("Processing"); - - /** - * Creates a new instance of DeviceState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeviceState() { - } - - /** - * Creates or finds a DeviceState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceState. - */ - public static DeviceState fromString(String name) { - return fromString(name, DeviceState.class); - } - - /** - * Gets known DeviceState values. - * - * @return known DeviceState values. - */ - public static Collection values() { - return values(DeviceState.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 000000000000..508dd6f0fabd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.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.util.ExpandableStringEnum; +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. + */ + 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/EceDeploymentSecrets.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceDeploymentSecrets.java deleted file mode 100644 index f1d95ce710ee..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceDeploymentSecrets.java +++ /dev/null @@ -1,149 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Protected parameters list stored in keyvault. - */ -@Fluent -public final class EceDeploymentSecrets implements JsonSerializable { - /* - * Secret name stored in keyvault. - */ - private String secretName; - - /* - * Secret name expected for Enterprise Cloud Engine (ECE) deployment. - */ - private EceSecrets eceSecretName; - - /* - * Secret URI stored in keyvault. - */ - private String secretLocation; - - /** - * Creates an instance of EceDeploymentSecrets class. - */ - public EceDeploymentSecrets() { - } - - /** - * Get the secretName property: Secret name stored in keyvault. - * - * @return the secretName value. - */ - public String secretName() { - return this.secretName; - } - - /** - * Set the secretName property: Secret name stored in keyvault. - * - * @param secretName the secretName value to set. - * @return the EceDeploymentSecrets object itself. - */ - public EceDeploymentSecrets withSecretName(String secretName) { - this.secretName = secretName; - return this; - } - - /** - * Get the eceSecretName property: Secret name expected for Enterprise Cloud Engine (ECE) deployment. - * - * @return the eceSecretName value. - */ - public EceSecrets eceSecretName() { - return this.eceSecretName; - } - - /** - * Set the eceSecretName property: Secret name expected for Enterprise Cloud Engine (ECE) deployment. - * - * @param eceSecretName the eceSecretName value to set. - * @return the EceDeploymentSecrets object itself. - */ - public EceDeploymentSecrets withEceSecretName(EceSecrets eceSecretName) { - this.eceSecretName = eceSecretName; - return this; - } - - /** - * Get the secretLocation property: Secret URI stored in keyvault. - * - * @return the secretLocation value. - */ - public String secretLocation() { - return this.secretLocation; - } - - /** - * Set the secretLocation property: Secret URI stored in keyvault. - * - * @param secretLocation the secretLocation value to set. - * @return the EceDeploymentSecrets object itself. - */ - public EceDeploymentSecrets withSecretLocation(String secretLocation) { - this.secretLocation = secretLocation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("secretName", this.secretName); - jsonWriter.writeStringField("eceSecretName", this.eceSecretName == null ? null : this.eceSecretName.toString()); - jsonWriter.writeStringField("secretLocation", this.secretLocation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EceDeploymentSecrets from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EceDeploymentSecrets if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the EceDeploymentSecrets. - */ - public static EceDeploymentSecrets fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EceDeploymentSecrets deserializedEceDeploymentSecrets = new EceDeploymentSecrets(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretName".equals(fieldName)) { - deserializedEceDeploymentSecrets.secretName = reader.getString(); - } else if ("eceSecretName".equals(fieldName)) { - deserializedEceDeploymentSecrets.eceSecretName = EceSecrets.fromString(reader.getString()); - } else if ("secretLocation".equals(fieldName)) { - deserializedEceDeploymentSecrets.secretLocation = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEceDeploymentSecrets; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceReportedProperties.java deleted file mode 100644 index 85698ddb5770..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceReportedProperties.java +++ /dev/null @@ -1,103 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The DeploymentStatus of AzureStackHCI Cluster. - */ -@Immutable -public final class EceReportedProperties implements JsonSerializable { - /* - * validation status of AzureStackHCI Cluster Deployment. - */ - private EceActionStatus validationStatus; - - /* - * Deployment status of AzureStackHCI Cluster Deployment. - */ - private EceActionStatus deploymentStatus; - - /** - * Creates an instance of EceReportedProperties class. - */ - public EceReportedProperties() { - } - - /** - * Get the validationStatus property: validation status of AzureStackHCI Cluster Deployment. - * - * @return the validationStatus value. - */ - public EceActionStatus validationStatus() { - return this.validationStatus; - } - - /** - * Get the deploymentStatus property: Deployment status of AzureStackHCI Cluster Deployment. - * - * @return the deploymentStatus value. - */ - public EceActionStatus deploymentStatus() { - return this.deploymentStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (validationStatus() != null) { - validationStatus().validate(); - } - if (deploymentStatus() != null) { - deploymentStatus().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EceReportedProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EceReportedProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the EceReportedProperties. - */ - public static EceReportedProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EceReportedProperties deserializedEceReportedProperties = new EceReportedProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("validationStatus".equals(fieldName)) { - deserializedEceReportedProperties.validationStatus = EceActionStatus.fromJson(reader); - } else if ("deploymentStatus".equals(fieldName)) { - deserializedEceReportedProperties.deploymentStatus = EceActionStatus.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedEceReportedProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceSecrets.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceSecrets.java deleted file mode 100644 index 45893efde3ae..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EceSecrets.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Secret names allowed for Enterprise Cloud Engine (ECE) deployment. - */ -public final class EceSecrets extends ExpandableStringEnum { - /** - * Static value AzureStackLCMUserCredential for EceSecrets. - */ - public static final EceSecrets AZURE_STACK_LCMUSER_CREDENTIAL = fromString("AzureStackLCMUserCredential"); - - /** - * Static value DefaultARBApplication for EceSecrets. - */ - public static final EceSecrets DEFAULT_ARBAPPLICATION = fromString("DefaultARBApplication"); - - /** - * Static value LocalAdminCredential for EceSecrets. - */ - public static final EceSecrets LOCAL_ADMIN_CREDENTIAL = fromString("LocalAdminCredential"); - - /** - * Static value WitnessStorageKey for EceSecrets. - */ - public static final EceSecrets WITNESS_STORAGE_KEY = fromString("WitnessStorageKey"); - - /** - * Creates a new instance of EceSecrets value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EceSecrets() { - } - - /** - * Creates or finds a EceSecrets from its string representation. - * - * @param name a name to look for. - * @return the corresponding EceSecrets. - */ - public static EceSecrets fromString(String name) { - return fromString(name, EceSecrets.class); - } - - /** - * Gets known EceSecrets values. - * - * @return known EceSecrets values. - */ - public static Collection values() { - return values(EceSecrets.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevice.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevice.java index 2a465117debe..27a74b998f71 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevice.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevice.java @@ -5,6 +5,7 @@ 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.EdgeDeviceInner; /** @@ -33,18 +34,25 @@ public interface EdgeDevice { String type(); /** - * Gets the kind property: Device kind to support polymorphic resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the kind value. + * @return the systemData value. */ - DeviceKind kind(); + SystemData systemData(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the deviceConfiguration property: Device Configuration. * - * @return the systemData value. + * @return the deviceConfiguration value. */ - SystemData systemData(); + DeviceConfiguration deviceConfiguration(); + + /** + * Gets the provisioningState property: Provisioning state of edgeDevice resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); /** * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner object. @@ -52,4 +60,177 @@ public interface EdgeDevice { * @return the inner object. */ EdgeDeviceInner innerModel(); + + /** + * The entirety of the EdgeDevice definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * The EdgeDevice definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EdgeDevice definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the EdgeDevice definition allowing to specify parent resource. + */ + interface WithScope { + /** + * Specifies resourceUri. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @return the next definition stage. + */ + WithCreate withExistingResourceUri(String resourceUri); + } + + /** + * The stage of the EdgeDevice 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.WithDeviceConfiguration, DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + EdgeDevice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EdgeDevice create(Context context); + } + + /** + * The stage of the EdgeDevice definition allowing to specify deviceConfiguration. + */ + interface WithDeviceConfiguration { + /** + * Specifies the deviceConfiguration property: Device Configuration. + * + * @param deviceConfiguration Device Configuration. + * @return the next definition stage. + */ + WithCreate withDeviceConfiguration(DeviceConfiguration deviceConfiguration); + } + + /** + * The stage of the EdgeDevice definition allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of edgeDevice resource. + * + * @param provisioningState Provisioning state of edgeDevice resource. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + } + + /** + * Begins update for the EdgeDevice resource. + * + * @return the stage of resource update. + */ + EdgeDevice.Update update(); + + /** + * The template for EdgeDevice update. + */ + interface Update extends UpdateStages.WithDeviceConfiguration, UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EdgeDevice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EdgeDevice apply(Context context); + } + + /** + * The EdgeDevice update stages. + */ + interface UpdateStages { + /** + * The stage of the EdgeDevice update allowing to specify deviceConfiguration. + */ + interface WithDeviceConfiguration { + /** + * Specifies the deviceConfiguration property: Device Configuration. + * + * @param deviceConfiguration Device Configuration. + * @return the next definition stage. + */ + Update withDeviceConfiguration(DeviceConfiguration deviceConfiguration); + } + + /** + * The stage of the EdgeDevice update allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of edgeDevice resource. + * + * @param provisioningState Provisioning state of edgeDevice resource. + * @return the next definition stage. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EdgeDevice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EdgeDevice refresh(Context context); + + /** + * A long-running resource action. + * + * @param validateRequest The content of the action 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 an Accepted response with an Operation-Location header. + */ + ValidateResponse validate(ValidateRequest validateRequest); + + /** + * A long-running resource action. + * + * @param validateRequest The content of the action 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 an Accepted response with an Operation-Location header. + */ + ValidateResponse validate(ValidateRequest validateRequest, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevices.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevices.java index f433de19d1ea..5b26372b729e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevices.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevices.java @@ -7,7 +7,6 @@ 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.EdgeDeviceInner; /** * Resource collection API of EdgeDevices. @@ -62,80 +61,105 @@ public interface EdgeDevices { EdgeDevice get(String resourceUri, String edgeDeviceName); /** - * Create a EdgeDevice. + * Delete a EdgeDevice. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param edgeDeviceName Name of Device. - * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return edge device resource. */ - EdgeDevice createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource); + void deleteByResourceGroup(String resourceUri, String edgeDeviceName); /** - * Create a EdgeDevice. + * Delete a EdgeDevice. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param edgeDeviceName Name of Device. - * @param resource Resource create parameters. * @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 edge device resource. */ - EdgeDevice createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource, Context context); + void delete(String resourceUri, String edgeDeviceName, Context context); /** - * Delete a EdgeDevice. + * A long-running resource action. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param edgeDeviceName Name of Device. + * @param validateRequest The content of the action 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 an Accepted response with an Operation-Location header. */ - void deleteByResourceGroup(String resourceUri, String edgeDeviceName); + ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest); /** - * Delete a EdgeDevice. + * A long-running resource action. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param edgeDeviceName Name of Device. + * @param validateRequest The content of the action 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 an Accepted response with an Operation-Location header. */ - void delete(String resourceUri, String edgeDeviceName, Context context); + ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, + Context context); /** - * A long-running resource action. + * Get a EdgeDevice. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param edgeDeviceName Name of Device. - * @param validateRequest The content of the action request. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Accepted response with an Operation-Location header. + * @return a EdgeDevice along with {@link Response}. */ - ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest); + EdgeDevice getById(String id); /** - * A long-running resource action. + * Get a EdgeDevice. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param edgeDeviceName Name of Device. - * @param validateRequest The content of the action request. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Accepted response with an Operation-Location header. + * @return a EdgeDevice along with {@link Response}. */ - ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, - Context context); + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EdgeDevice. + * + * @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 a EdgeDevice. + * + * @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 EdgeDevice resource. + * + * @param name resource name. + * @return the first stage of the new EdgeDevice definition. + */ + EdgeDevice.DefinitionStages.Blank define(String name); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java similarity index 50% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerProperties.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java index 8c1a53511465..c4d2efd77910 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java @@ -12,28 +12,28 @@ import java.io.IOException; /** - * Solution builder extension (SBE) partner properties object. + * The complex type of the extended location. */ @Fluent -public final class SbePartnerProperties implements JsonSerializable { +public final class ExtendedLocation implements JsonSerializable { /* - * SBE partner property name. + * The name of the extended location. */ private String name; /* - * SBE partner property value. + * The type of the extended location. */ - private String value; + private ExtendedLocationTypes type; /** - * Creates an instance of SbePartnerProperties class. + * Creates an instance of ExtendedLocation class. */ - public SbePartnerProperties() { + public ExtendedLocation() { } /** - * Get the name property: SBE partner property name. + * Get the name property: The name of the extended location. * * @return the name value. */ @@ -42,33 +42,33 @@ public String name() { } /** - * Set the name property: SBE partner property name. + * Set the name property: The name of the extended location. * * @param name the name value to set. - * @return the SbePartnerProperties object itself. + * @return the ExtendedLocation object itself. */ - public SbePartnerProperties withName(String name) { + public ExtendedLocation withName(String name) { this.name = name; return this; } /** - * Get the value property: SBE partner property value. + * Get the type property: The type of the extended location. * - * @return the value value. + * @return the type value. */ - public String value() { - return this.value; + public ExtendedLocationTypes type() { + return this.type; } /** - * Set the value property: SBE partner property value. + * Set the type property: The type of the extended location. * - * @param value the value value to set. - * @return the SbePartnerProperties object itself. + * @param type the type value to set. + * @return the ExtendedLocation object itself. */ - public SbePartnerProperties withValue(String value) { - this.value = value; + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; return this; } @@ -87,35 +87,35 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } /** - * Reads an instance of SbePartnerProperties from the JsonReader. + * Reads an instance of ExtendedLocation from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of SbePartnerProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SbePartnerProperties. + * @return An instance of ExtendedLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtendedLocation. */ - public static SbePartnerProperties fromJson(JsonReader jsonReader) throws IOException { + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - SbePartnerProperties deserializedSbePartnerProperties = new SbePartnerProperties(); + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { - deserializedSbePartnerProperties.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedSbePartnerProperties.value = reader.getString(); + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedSbePartnerProperties; + return deserializedExtendedLocation; }); } } 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 000000000000..bafff18ac4ed --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocationTypes.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.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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/ExtensionManagedBy.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionManagedBy.java index ac93d8b956ed..31f40d1273df 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionManagedBy.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionManagedBy.java @@ -8,18 +8,18 @@ import java.util.Collection; /** - * Extension managed by user or Azure. + * Indicates if the extension is managed by azure or the user. */ public final class ExtensionManagedBy extends ExpandableStringEnum { /** - * Static value User for ExtensionManagedBy. + * Static value Azure for ExtensionManagedBy. */ - public static final ExtensionManagedBy USER = fromString("User"); + public static final ExtensionManagedBy AZURE = fromString("Azure"); /** - * Static value Azure for ExtensionManagedBy. + * Static value User for ExtensionManagedBy. */ - public static final ExtensionManagedBy AZURE = fromString("Azure"); + public static final ExtensionManagedBy USER = fromString("User"); /** * Creates a new instance of ExtensionManagedBy value. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java similarity index 53% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionProfile.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java index fbc49dfd74d6..e46254eb42bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionProfile.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java @@ -10,31 +10,41 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.List; /** - * Extensions details for edge device. + * This is the disk image base class. */ @Immutable -public final class ExtensionProfile implements JsonSerializable { +public class GalleryDiskImage implements JsonSerializable { /* - * List of Arc extensions installed on edge device. + * This property indicates the size of the VHD to be created. */ - private List extensions; + private Long sizeInMB; /** - * Creates an instance of ExtensionProfile class. + * Creates an instance of GalleryDiskImage class. */ - public ExtensionProfile() { + public GalleryDiskImage() { } /** - * Get the extensions property: List of Arc extensions installed on edge device. + * Get the sizeInMB property: This property indicates the size of the VHD to be created. * - * @return the extensions value. + * @return the sizeInMB value. */ - public List extensions() { - return this.extensions; + public Long sizeInMB() { + return this.sizeInMB; + } + + /** + * Set the sizeInMB property: This property indicates the size of the VHD to be created. + * + * @param sizeInMB the sizeInMB value to set. + * @return the GalleryDiskImage object itself. + */ + GalleryDiskImage withSizeInMB(Long sizeInMB) { + this.sizeInMB = sizeInMB; + return this; } /** @@ -43,9 +53,6 @@ public List extensions() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } } /** @@ -58,30 +65,28 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ExtensionProfile from the JsonReader. + * Reads an instance of GalleryDiskImage from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ExtensionProfile if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of GalleryDiskImage if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IOException If an error occurs while reading the ExtensionProfile. + * @throws IOException If an error occurs while reading the GalleryDiskImage. */ - public static ExtensionProfile fromJson(JsonReader jsonReader) throws IOException { + public static GalleryDiskImage fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ExtensionProfile deserializedExtensionProfile = new ExtensionProfile(); + GalleryDiskImage deserializedGalleryDiskImage = new GalleryDiskImage(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("extensions".equals(fieldName)) { - List extensions - = reader.readArray(reader1 -> HciEdgeDeviceArcExtension.fromJson(reader1)); - deserializedExtensionProfile.extensions = extensions; + if ("sizeInMB".equals(fieldName)) { + deserializedGalleryDiskImage.sizeInMB = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } } - return deserializedExtensionProfile; + return deserializedGalleryDiskImage; }); } } 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 000000000000..c52dbb22cf4d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageIdentifier.java @@ -0,0 +1,166 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This is the gallery image definition identifier. + */ +@Fluent +public final class GalleryImageIdentifier implements JsonSerializable { + /* + * The name of the gallery image definition publisher. + */ + private String publisher; + + /* + * The name of the gallery image definition offer. + */ + private String offer; + + /* + * The name of the gallery image definition SKU. + */ + 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.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model GalleryImageIdentifier")); + } + if (offer() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); + } + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model GalleryImageIdentifier")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageIdentifier.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageIdentifier if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GalleryImageIdentifier. + */ + public static GalleryImageIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageIdentifier deserializedGalleryImageIdentifier = new GalleryImageIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisher".equals(fieldName)) { + deserializedGalleryImageIdentifier.publisher = reader.getString(); + } else if ("offer".equals(fieldName)) { + deserializedGalleryImageIdentifier.offer = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedGalleryImageIdentifier.sku = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageIdentifier; + }); + } +} 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 000000000000..9fe726573855 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatus.java @@ -0,0 +1,212 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of gallery images. + */ +@Fluent +public final class GalleryImageStatus implements JsonSerializable { + /* + * GalleryImage provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The provisioningStatus property. + */ + private GalleryImageStatusProvisioningStatus provisioningStatus; + + /* + * The download status of the gallery image + */ + private GalleryImageStatusDownloadStatus downloadStatus; + + /* + * The progress of the operation in percentage + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + jsonWriter.writeJsonField("downloadStatus", this.downloadStatus); + jsonWriter.writeNumberField("progressPercentage", this.progressPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImageStatus. + */ + public static GalleryImageStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageStatus deserializedGalleryImageStatus = new GalleryImageStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedGalleryImageStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedGalleryImageStatus.errorMessage = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedGalleryImageStatus.provisioningStatus + = GalleryImageStatusProvisioningStatus.fromJson(reader); + } else if ("downloadStatus".equals(fieldName)) { + deserializedGalleryImageStatus.downloadStatus = GalleryImageStatusDownloadStatus.fromJson(reader); + } else if ("progressPercentage".equals(fieldName)) { + deserializedGalleryImageStatus.progressPercentage = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageStatus; + }); + } +} 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 000000000000..742549137704 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusDownloadStatus.java @@ -0,0 +1,95 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The download status of the gallery image. + */ +@Fluent +public final class GalleryImageStatusDownloadStatus implements JsonSerializable { + /* + * The downloaded sized of the image in MB + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("downloadSizeInMB", this.downloadSizeInMB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageStatusDownloadStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageStatusDownloadStatus if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImageStatusDownloadStatus. + */ + public static GalleryImageStatusDownloadStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageStatusDownloadStatus deserializedGalleryImageStatusDownloadStatus + = new GalleryImageStatusDownloadStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("downloadSizeInMB".equals(fieldName)) { + deserializedGalleryImageStatusDownloadStatus.downloadSizeInMB + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageStatusDownloadStatus; + }); + } +} 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 000000000000..40c0b2782805 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageStatusProvisioningStatus.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GalleryImageStatusProvisioningStatus model. + */ +@Fluent +public final class GalleryImageStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the gallery image + */ + private String operationId; + + /* + * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageStatusProvisioningStatus if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImageStatusProvisioningStatus. + */ + public static GalleryImageStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageStatusProvisioningStatus deserializedGalleryImageStatusProvisioningStatus + = new GalleryImageStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedGalleryImageStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedGalleryImageStatusProvisioningStatus.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageStatusProvisioningStatus; + }); + } +} 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 000000000000..7a62685d16fa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersion.java @@ -0,0 +1,137 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImageVersionProperties; +import java.io.IOException; + +/** + * Specifies information about the gallery image version that you want to create or update. + */ +@Fluent +public final class GalleryImageVersion implements JsonSerializable { + /* + * This is the version of the gallery image. + */ + private String name; + + /* + * Describes the properties of a gallery image version. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImageVersion. + */ + public static GalleryImageVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageVersion deserializedGalleryImageVersion = new GalleryImageVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedGalleryImageVersion.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGalleryImageVersion.innerProperties = GalleryImageVersionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageVersion; + }); + } +} 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 000000000000..07265a06d152 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImageVersionStorageProfile.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This is the storage profile of a Gallery Image Version. + */ +@Fluent +public final class GalleryImageVersionStorageProfile implements JsonSerializable { + /* + * This is the OS disk image. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("osDiskImage", this.osDiskImage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImageVersionStorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImageVersionStorageProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImageVersionStorageProfile. + */ + public static GalleryImageVersionStorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImageVersionStorageProfile deserializedGalleryImageVersionStorageProfile + = new GalleryImageVersionStorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osDiskImage".equals(fieldName)) { + deserializedGalleryImageVersionStorageProfile.osDiskImage = GalleryOSDiskImage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImageVersionStorageProfile; + }); + } +} 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 000000000000..f307a6a78d4e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImages.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.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/GalleryImagesListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesListResult.java new file mode 100644 index 000000000000..c62e5d923b6c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesListResult.java @@ -0,0 +1,115 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; +import java.io.IOException; +import java.util.List; + +/** + * List of gallery images. + */ +@Fluent +public final class GalleryImagesListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of GalleryImagesListResult class. + */ + public GalleryImagesListResult() { + } + + /** + * 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 GalleryImagesListResult object itself. + */ + public GalleryImagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImagesListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImagesListResult. + */ + public static GalleryImagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImagesListResult deserializedGalleryImagesListResult = new GalleryImagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GalleryImagesInner.fromJson(reader1)); + deserializedGalleryImagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGalleryImagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImagesListResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.java new file mode 100644 index 000000000000..c6d82863087d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesOperations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of GalleryImagesOperations. + */ +public interface GalleryImagesOperations { + /** + * 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}. + */ + 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. + */ + GalleryImages getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 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. + */ + void delete(String resourceGroupName, String galleryImageName, 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}. + */ + 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}. + */ + 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}. + */ + PagedIterable list(Context context); + + /** + * 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 a gallery image along with {@link Response}. + */ + GalleryImages getById(String id); + + /** + * 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 a gallery image along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete 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. + */ + void deleteById(String id); + + /** + * The operation to delete 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GalleryImages resource. + * + * @param name resource name. + * @return the first stage of the new GalleryImages definition. + */ + 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 000000000000..590b27cc02b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryImagesUpdateRequest.java @@ -0,0 +1,95 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The gallery images resource patch definition. + */ +@Fluent +public final class GalleryImagesUpdateRequest implements JsonSerializable { + /* + * Resource tags + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryImagesUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryImagesUpdateRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryImagesUpdateRequest. + */ + public static GalleryImagesUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryImagesUpdateRequest deserializedGalleryImagesUpdateRequest = new GalleryImagesUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryImagesUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryImagesUpdateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciValidationFailureDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java similarity index 52% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciValidationFailureDetail.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java index 171bd91b1e12..fb9d5b93a669 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciValidationFailureDetail.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java @@ -6,34 +6,34 @@ import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; /** - * details of validation failure. + * This is the OS disk image. */ @Immutable -public final class HciValidationFailureDetail implements JsonSerializable { +public final class GalleryOSDiskImage extends GalleryDiskImage { /* - * Exception details while installing extension. + * This property indicates the size of the VHD to be created. */ - private String exception; + private Long sizeInMB; /** - * Creates an instance of HciValidationFailureDetail class. + * Creates an instance of GalleryOSDiskImage class. */ - public HciValidationFailureDetail() { + public GalleryOSDiskImage() { } /** - * Get the exception property: Exception details while installing extension. + * Get the sizeInMB property: This property indicates the size of the VHD to be created. * - * @return the exception value. + * @return the sizeInMB value. */ - public String exception() { - return this.exception; + @Override + public Long sizeInMB() { + return this.sizeInMB; } /** @@ -41,6 +41,7 @@ public String exception() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { } @@ -54,28 +55,28 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of HciValidationFailureDetail from the JsonReader. + * Reads an instance of GalleryOSDiskImage from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of HciValidationFailureDetail if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciValidationFailureDetail. + * @return An instance of GalleryOSDiskImage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryOSDiskImage. */ - public static HciValidationFailureDetail fromJson(JsonReader jsonReader) throws IOException { + public static GalleryOSDiskImage fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - HciValidationFailureDetail deserializedHciValidationFailureDetail = new HciValidationFailureDetail(); + GalleryOSDiskImage deserializedGalleryOSDiskImage = new GalleryOSDiskImage(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("exception".equals(fieldName)) { - deserializedHciValidationFailureDetail.exception = reader.getString(); + if ("sizeInMB".equals(fieldName)) { + deserializedGalleryOSDiskImage.sizeInMB = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } } - return deserializedHciValidationFailureDetail; + return deserializedGalleryOSDiskImage; }); } } 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 000000000000..5dd7eeecdbd1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgent.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.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the credentials property: Username / Password Credentials to provision guest agent. + * + * @return the credentials value. + */ + GuestCredential credentials(); + + /** + * 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 000000000000..edcce50c17e0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentInstallStatus.java @@ -0,0 +1,151 @@ +// Copyright (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.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Defines the status of a guest agent installation. + */ +@Immutable +public final class GuestAgentInstallStatus implements JsonSerializable { + /* + * Specifies the VM's unique SMBIOS ID. + */ + private String vmUuid; + + /* + * The installation status of the hybrid machine agent installation. + */ + private StatusTypes status; + + /* + * The time of the last status change. + */ + private OffsetDateTime lastStatusChange; + + /* + * The hybrid machine agent full version. + */ + private String agentVersion; + + /* + * Details about the error state. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuestAgentInstallStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuestAgentInstallStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GuestAgentInstallStatus. + */ + public static GuestAgentInstallStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuestAgentInstallStatus deserializedGuestAgentInstallStatus = new GuestAgentInstallStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmUuid".equals(fieldName)) { + deserializedGuestAgentInstallStatus.vmUuid = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedGuestAgentInstallStatus.status = StatusTypes.fromString(reader.getString()); + } else if ("lastStatusChange".equals(fieldName)) { + deserializedGuestAgentInstallStatus.lastStatusChange = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("agentVersion".equals(fieldName)) { + deserializedGuestAgentInstallStatus.agentVersion = reader.getString(); + } else if ("errorDetails".equals(fieldName)) { + List errorDetails = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedGuestAgentInstallStatus.errorDetails = errorDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedGuestAgentInstallStatus; + }); + } +} 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 000000000000..bf2f9859e988 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentList.java @@ -0,0 +1,134 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of GuestAgent. + */ +@Fluent +public final class GuestAgentList implements JsonSerializable { + /* + * Url to follow for getting next page of GuestAgent. + */ + private String nextLink; + + /* + * Array of GuestAgent + */ + 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.atError() + .log(new IllegalArgumentException("Missing required property value in model GuestAgentList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuestAgentList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuestAgentList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GuestAgentList. + */ + public static GuestAgentList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuestAgentList deserializedGuestAgentList = new GuestAgentList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GuestAgentInner.fromJson(reader1)); + deserializedGuestAgentList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGuestAgentList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGuestAgentList; + }); + } +} 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 000000000000..e563437fca7e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgents.java @@ -0,0 +1,100 @@ +// Copyright (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 000000000000..b2ae9de0bad5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestAgentsOperations.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.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 000000000000..a8c36cb97cdb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GuestCredential.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Username / Password Credentials to connect to guest. + */ +@Fluent +public final class GuestCredential implements JsonSerializable { + /* + * The username to connect with the guest. + */ + private String username; + + /* + * The password to connect with the guest. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("password", this.password); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuestCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuestCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GuestCredential. + */ + public static GuestCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuestCredential deserializedGuestCredential = new GuestCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("username".equals(fieldName)) { + deserializedGuestCredential.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedGuestCredential.password = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGuestCredential; + }); + } +} 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 000000000000..9d9fc0a870d4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java @@ -0,0 +1,149 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ +@Fluent +public final class HardwareProfileUpdate implements JsonSerializable { + /* + * The vmSize property. + */ + private VmSizeEnum vmSize; + + /* + * number of processors for the virtual machine instance + */ + private Integer processors; + + /* + * RAM in MB for the virtual machine instance + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize == null ? null : this.vmSize.toString()); + jsonWriter.writeNumberField("processors", this.processors); + jsonWriter.writeNumberField("memoryMB", this.memoryMB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HardwareProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HardwareProfileUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HardwareProfileUpdate. + */ + public static HardwareProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HardwareProfileUpdate deserializedHardwareProfileUpdate = new HardwareProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedHardwareProfileUpdate.vmSize = VmSizeEnum.fromString(reader.getString()); + } else if ("processors".equals(fieldName)) { + deserializedHardwareProfileUpdate.processors = reader.getNullable(JsonReader::getInt); + } else if ("memoryMB".equals(fieldName)) { + deserializedHardwareProfileUpdate.memoryMB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedHardwareProfileUpdate; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDevice.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDevice.java deleted file mode 100644 index df12eaed1d2d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDevice.java +++ /dev/null @@ -1,186 +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.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; -import java.io.IOException; - -/** - * Arc-enabled edge device with HCI OS. - */ -@Fluent -public final class HciEdgeDevice extends EdgeDeviceInner { - /* - * Device kind to support polymorphic resource. - */ - private DeviceKind kind = DeviceKind.HCI; - - /* - * properties for Arc-enabled edge device with HCI OS. - */ - private HciEdgeDeviceProperties properties; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /* - * The name of the resource. - */ - private String name; - - /* - * The type of the resource. - */ - private String type; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /** - * Creates an instance of HciEdgeDevice class. - */ - public HciEdgeDevice() { - } - - /** - * Get the kind property: Device kind to support polymorphic resource. - * - * @return the kind value. - */ - @Override - public DeviceKind kind() { - return this.kind; - } - - /** - * Get the properties property: properties for Arc-enabled edge device with HCI OS. - * - * @return the properties value. - */ - public HciEdgeDeviceProperties properties() { - return this.properties; - } - - /** - * Set the properties property: properties for Arc-enabled edge device with HCI OS. - * - * @param properties the properties value to set. - * @return the HciEdgeDevice object itself. - */ - public HciEdgeDevice withProperties(HciEdgeDeviceProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - @Override - public SystemData systemData() { - return this.systemData; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDevice from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDevice if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the HciEdgeDevice. - */ - public static HciEdgeDevice fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDevice deserializedHciEdgeDevice = new HciEdgeDevice(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedHciEdgeDevice.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedHciEdgeDevice.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedHciEdgeDevice.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedHciEdgeDevice.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedHciEdgeDevice.kind = DeviceKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedHciEdgeDevice.properties = HciEdgeDeviceProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDevice; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceAdapterPropertyOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceAdapterPropertyOverrides.java deleted file mode 100644 index bd6cd773da02..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceAdapterPropertyOverrides.java +++ /dev/null @@ -1,121 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AdapterPropertyOverrides of a cluster. - */ -@Immutable -public final class HciEdgeDeviceAdapterPropertyOverrides - implements JsonSerializable { - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. - */ - private String jumboPacket; - - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. - */ - private String networkDirect; - - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. Expected values are 'iWARP', 'RoCEv2', 'RoCE' - */ - private String networkDirectTechnology; - - /** - * Creates an instance of HciEdgeDeviceAdapterPropertyOverrides class. - */ - public HciEdgeDeviceAdapterPropertyOverrides() { - } - - /** - * Get the jumboPacket property: This parameter should only be modified based on your OEM guidance. Do not modify - * this parameter without OEM validation. - * - * @return the jumboPacket value. - */ - public String jumboPacket() { - return this.jumboPacket; - } - - /** - * Get the networkDirect property: This parameter should only be modified based on your OEM guidance. Do not modify - * this parameter without OEM validation. - * - * @return the networkDirect value. - */ - public String networkDirect() { - return this.networkDirect; - } - - /** - * Get the networkDirectTechnology property: This parameter should only be modified based on your OEM guidance. Do - * not modify this parameter without OEM validation. Expected values are 'iWARP', 'RoCEv2', 'RoCE'. - * - * @return the networkDirectTechnology value. - */ - public String networkDirectTechnology() { - return this.networkDirectTechnology; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceAdapterPropertyOverrides from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceAdapterPropertyOverrides if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceAdapterPropertyOverrides. - */ - public static HciEdgeDeviceAdapterPropertyOverrides fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceAdapterPropertyOverrides deserializedHciEdgeDeviceAdapterPropertyOverrides - = new HciEdgeDeviceAdapterPropertyOverrides(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("jumboPacket".equals(fieldName)) { - deserializedHciEdgeDeviceAdapterPropertyOverrides.jumboPacket = reader.getString(); - } else if ("networkDirect".equals(fieldName)) { - deserializedHciEdgeDeviceAdapterPropertyOverrides.networkDirect = reader.getString(); - } else if ("networkDirectTechnology".equals(fieldName)) { - deserializedHciEdgeDeviceAdapterPropertyOverrides.networkDirectTechnology = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceAdapterPropertyOverrides; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceArcExtension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceArcExtension.java deleted file mode 100644 index d2eec0715cce..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceArcExtension.java +++ /dev/null @@ -1,167 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Arc extension installed on edge device. - */ -@Immutable -public final class HciEdgeDeviceArcExtension implements JsonSerializable { - /* - * Arc extension name installed on edge device. - */ - private String extensionName; - - /* - * Arc extension state from arc machine extension. - */ - private ArcExtensionState state; - - /* - * Error details while installing Arc extension. - */ - private List errorDetails; - - /* - * Arc Extension Azure resource id. - */ - private String extensionResourceId; - - /* - * Extension version installed. - */ - private String typeHandlerVersion; - - /* - * Extension managed by user or Azure. - */ - private ExtensionManagedBy managedBy; - - /** - * Creates an instance of HciEdgeDeviceArcExtension class. - */ - public HciEdgeDeviceArcExtension() { - } - - /** - * Get the extensionName property: Arc extension name installed on edge device. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Get the state property: Arc extension state from arc machine extension. - * - * @return the state value. - */ - public ArcExtensionState state() { - return this.state; - } - - /** - * Get the errorDetails property: Error details while installing Arc extension. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the extensionResourceId property: Arc Extension Azure resource id. - * - * @return the extensionResourceId value. - */ - public String extensionResourceId() { - return this.extensionResourceId; - } - - /** - * Get the typeHandlerVersion property: Extension version installed. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Get the managedBy property: Extension managed by user or Azure. - * - * @return the managedBy value. - */ - public ExtensionManagedBy managedBy() { - return this.managedBy; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceArcExtension from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceArcExtension if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceArcExtension. - */ - public static HciEdgeDeviceArcExtension fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceArcExtension deserializedHciEdgeDeviceArcExtension = new HciEdgeDeviceArcExtension(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("extensionName".equals(fieldName)) { - deserializedHciEdgeDeviceArcExtension.extensionName = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedHciEdgeDeviceArcExtension.state = ArcExtensionState.fromString(reader.getString()); - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> HciValidationFailureDetail.fromJson(reader1)); - deserializedHciEdgeDeviceArcExtension.errorDetails = errorDetails; - } else if ("extensionResourceId".equals(fieldName)) { - deserializedHciEdgeDeviceArcExtension.extensionResourceId = reader.getString(); - } else if ("typeHandlerVersion".equals(fieldName)) { - deserializedHciEdgeDeviceArcExtension.typeHandlerVersion = reader.getString(); - } else if ("managedBy".equals(fieldName)) { - deserializedHciEdgeDeviceArcExtension.managedBy = ExtensionManagedBy.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceArcExtension; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceHostNetwork.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceHostNetwork.java deleted file mode 100644 index 0f48bef719ec..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceHostNetwork.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The HostNetwork of a cluster. - */ -@Immutable -public final class HciEdgeDeviceHostNetwork implements JsonSerializable { - /* - * The network intents assigned to the network reference pattern used for the deployment. Each intent will define - * its own name, traffic type, adapter names, and overrides as recommended by your OEM. - */ - private List intents; - - /* - * List of StorageNetworks config to deploy AzureStackHCI Cluster. - */ - private List storageNetworks; - - /* - * Defines how the storage adapters between nodes are connected either switch or switch less. - */ - private Boolean storageConnectivitySwitchless; - - /* - * Optional parameter required only for 3 Nodes Switchless deployments. This allows users to specify IPs and Mask - * for Storage NICs when Network ATC is not assigning the IPs for storage automatically. - */ - private Boolean enableStorageAutoIp; - - /** - * Creates an instance of HciEdgeDeviceHostNetwork class. - */ - public HciEdgeDeviceHostNetwork() { - } - - /** - * Get the intents property: The network intents assigned to the network reference pattern used for the deployment. - * Each intent will define its own name, traffic type, adapter names, and overrides as recommended by your OEM. - * - * @return the intents value. - */ - public List intents() { - return this.intents; - } - - /** - * Get the storageNetworks property: List of StorageNetworks config to deploy AzureStackHCI Cluster. - * - * @return the storageNetworks value. - */ - public List storageNetworks() { - return this.storageNetworks; - } - - /** - * Get the storageConnectivitySwitchless property: Defines how the storage adapters between nodes are connected - * either switch or switch less. - * - * @return the storageConnectivitySwitchless value. - */ - public Boolean storageConnectivitySwitchless() { - return this.storageConnectivitySwitchless; - } - - /** - * Get the enableStorageAutoIp property: Optional parameter required only for 3 Nodes Switchless deployments. This - * allows users to specify IPs and Mask for Storage NICs when Network ATC is not assigning the IPs for storage - * automatically. - * - * @return the enableStorageAutoIp value. - */ - public Boolean enableStorageAutoIp() { - return this.enableStorageAutoIp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (intents() != null) { - intents().forEach(e -> e.validate()); - } - if (storageNetworks() != null) { - storageNetworks().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceHostNetwork from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceHostNetwork if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceHostNetwork. - */ - public static HciEdgeDeviceHostNetwork fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceHostNetwork deserializedHciEdgeDeviceHostNetwork = new HciEdgeDeviceHostNetwork(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("intents".equals(fieldName)) { - List intents - = reader.readArray(reader1 -> HciEdgeDeviceIntents.fromJson(reader1)); - deserializedHciEdgeDeviceHostNetwork.intents = intents; - } else if ("storageNetworks".equals(fieldName)) { - List storageNetworks - = reader.readArray(reader1 -> HciEdgeDeviceStorageNetworks.fromJson(reader1)); - deserializedHciEdgeDeviceHostNetwork.storageNetworks = storageNetworks; - } else if ("storageConnectivitySwitchless".equals(fieldName)) { - deserializedHciEdgeDeviceHostNetwork.storageConnectivitySwitchless - = reader.getNullable(JsonReader::getBoolean); - } else if ("enableStorageAutoIp".equals(fieldName)) { - deserializedHciEdgeDeviceHostNetwork.enableStorageAutoIp - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceHostNetwork; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceIntents.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceIntents.java deleted file mode 100644 index f9869d09becd..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceIntents.java +++ /dev/null @@ -1,358 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The Intents of a cluster. - */ -@Immutable -public final class HciEdgeDeviceIntents implements JsonSerializable { - /* - * Scope for host network intent. - */ - private Long scope; - - /* - * IntentType for host network intent. - */ - private Long intentType; - - /* - * IsComputeIntentSet for host network intent. - */ - private Boolean isComputeIntentSet; - - /* - * IsStorageIntentSet for host network intent. - */ - private Boolean isStorageIntentSet; - - /* - * IntentType for host network intent. - */ - private Boolean isOnlyStorage; - - /* - * IsManagementIntentSet for host network intent. - */ - private Boolean isManagementIntentSet; - - /* - * IsStretchIntentSet for host network intent. - */ - private Boolean isStretchIntentSet; - - /* - * IsOnlyStretch for host network intent. - */ - private Boolean isOnlyStretch; - - /* - * IsNetworkIntentType for host network intent. - */ - private Boolean isNetworkIntentType; - - /* - * Name of the network intent you wish to create. - */ - private String intentName; - - /* - * Array of adapters used for the network intent. - */ - private List intentAdapters; - - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. - */ - private Boolean overrideVirtualSwitchConfiguration; - - /* - * Set virtualSwitch ConfigurationOverrides for cluster. - */ - private HciEdgeDeviceVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides; - - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. - */ - private Boolean overrideQosPolicy; - - /* - * Set QoS PolicyOverrides for cluster. - */ - private QosPolicyOverrides qosPolicyOverrides; - - /* - * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM - * validation. - */ - private Boolean overrideAdapterProperty; - - /* - * Set Adapter PropertyOverrides for cluster. - */ - private HciEdgeDeviceAdapterPropertyOverrides adapterPropertyOverrides; - - /** - * Creates an instance of HciEdgeDeviceIntents class. - */ - public HciEdgeDeviceIntents() { - } - - /** - * Get the scope property: Scope for host network intent. - * - * @return the scope value. - */ - public Long scope() { - return this.scope; - } - - /** - * Get the intentType property: IntentType for host network intent. - * - * @return the intentType value. - */ - public Long intentType() { - return this.intentType; - } - - /** - * Get the isComputeIntentSet property: IsComputeIntentSet for host network intent. - * - * @return the isComputeIntentSet value. - */ - public Boolean isComputeIntentSet() { - return this.isComputeIntentSet; - } - - /** - * Get the isStorageIntentSet property: IsStorageIntentSet for host network intent. - * - * @return the isStorageIntentSet value. - */ - public Boolean isStorageIntentSet() { - return this.isStorageIntentSet; - } - - /** - * Get the isOnlyStorage property: IntentType for host network intent. - * - * @return the isOnlyStorage value. - */ - public Boolean isOnlyStorage() { - return this.isOnlyStorage; - } - - /** - * Get the isManagementIntentSet property: IsManagementIntentSet for host network intent. - * - * @return the isManagementIntentSet value. - */ - public Boolean isManagementIntentSet() { - return this.isManagementIntentSet; - } - - /** - * Get the isStretchIntentSet property: IsStretchIntentSet for host network intent. - * - * @return the isStretchIntentSet value. - */ - public Boolean isStretchIntentSet() { - return this.isStretchIntentSet; - } - - /** - * Get the isOnlyStretch property: IsOnlyStretch for host network intent. - * - * @return the isOnlyStretch value. - */ - public Boolean isOnlyStretch() { - return this.isOnlyStretch; - } - - /** - * Get the isNetworkIntentType property: IsNetworkIntentType for host network intent. - * - * @return the isNetworkIntentType value. - */ - public Boolean isNetworkIntentType() { - return this.isNetworkIntentType; - } - - /** - * Get the intentName property: Name of the network intent you wish to create. - * - * @return the intentName value. - */ - public String intentName() { - return this.intentName; - } - - /** - * Get the intentAdapters property: Array of adapters used for the network intent. - * - * @return the intentAdapters value. - */ - public List intentAdapters() { - return this.intentAdapters; - } - - /** - * Get the overrideVirtualSwitchConfiguration property: This parameter should only be modified based on your OEM - * guidance. Do not modify this parameter without OEM validation. - * - * @return the overrideVirtualSwitchConfiguration value. - */ - public Boolean overrideVirtualSwitchConfiguration() { - return this.overrideVirtualSwitchConfiguration; - } - - /** - * Get the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster. - * - * @return the virtualSwitchConfigurationOverrides value. - */ - public HciEdgeDeviceVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides() { - return this.virtualSwitchConfigurationOverrides; - } - - /** - * Get the overrideQosPolicy property: This parameter should only be modified based on your OEM guidance. Do not - * modify this parameter without OEM validation. - * - * @return the overrideQosPolicy value. - */ - public Boolean overrideQosPolicy() { - return this.overrideQosPolicy; - } - - /** - * Get the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster. - * - * @return the qosPolicyOverrides value. - */ - public QosPolicyOverrides qosPolicyOverrides() { - return this.qosPolicyOverrides; - } - - /** - * Get the overrideAdapterProperty property: This parameter should only be modified based on your OEM guidance. Do - * not modify this parameter without OEM validation. - * - * @return the overrideAdapterProperty value. - */ - public Boolean overrideAdapterProperty() { - return this.overrideAdapterProperty; - } - - /** - * Get the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster. - * - * @return the adapterPropertyOverrides value. - */ - public HciEdgeDeviceAdapterPropertyOverrides adapterPropertyOverrides() { - return this.adapterPropertyOverrides; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualSwitchConfigurationOverrides() != null) { - virtualSwitchConfigurationOverrides().validate(); - } - if (qosPolicyOverrides() != null) { - qosPolicyOverrides().validate(); - } - if (adapterPropertyOverrides() != null) { - adapterPropertyOverrides().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceIntents from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceIntents if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceIntents. - */ - public static HciEdgeDeviceIntents fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceIntents deserializedHciEdgeDeviceIntents = new HciEdgeDeviceIntents(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scope".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.scope = reader.getNullable(JsonReader::getLong); - } else if ("intentType".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.intentType = reader.getNullable(JsonReader::getLong); - } else if ("isComputeIntentSet".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isComputeIntentSet = reader.getNullable(JsonReader::getBoolean); - } else if ("isStorageIntentSet".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isStorageIntentSet = reader.getNullable(JsonReader::getBoolean); - } else if ("isOnlyStorage".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isOnlyStorage = reader.getNullable(JsonReader::getBoolean); - } else if ("isManagementIntentSet".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isManagementIntentSet = reader.getNullable(JsonReader::getBoolean); - } else if ("isStretchIntentSet".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isStretchIntentSet = reader.getNullable(JsonReader::getBoolean); - } else if ("isOnlyStretch".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isOnlyStretch = reader.getNullable(JsonReader::getBoolean); - } else if ("isNetworkIntentType".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.isNetworkIntentType = reader.getNullable(JsonReader::getBoolean); - } else if ("intentName".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.intentName = reader.getString(); - } else if ("intentAdapters".equals(fieldName)) { - List intentAdapters = reader.readArray(reader1 -> reader1.getString()); - deserializedHciEdgeDeviceIntents.intentAdapters = intentAdapters; - } else if ("overrideVirtualSwitchConfiguration".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.overrideVirtualSwitchConfiguration - = reader.getNullable(JsonReader::getBoolean); - } else if ("virtualSwitchConfigurationOverrides".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.virtualSwitchConfigurationOverrides - = HciEdgeDeviceVirtualSwitchConfigurationOverrides.fromJson(reader); - } else if ("overrideQosPolicy".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.overrideQosPolicy = reader.getNullable(JsonReader::getBoolean); - } else if ("qosPolicyOverrides".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.qosPolicyOverrides = QosPolicyOverrides.fromJson(reader); - } else if ("overrideAdapterProperty".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.overrideAdapterProperty - = reader.getNullable(JsonReader::getBoolean); - } else if ("adapterPropertyOverrides".equals(fieldName)) { - deserializedHciEdgeDeviceIntents.adapterPropertyOverrides - = HciEdgeDeviceAdapterPropertyOverrides.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceIntents; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceProperties.java deleted file mode 100644 index 1947cf4c902c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceProperties.java +++ /dev/null @@ -1,115 +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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * properties for Arc-enabled edge device with HCI OS. - */ -@Fluent -public final class HciEdgeDeviceProperties extends EdgeDeviceProperties { - /* - * The instance view of all current configurations on HCI device. - */ - private HciReportedProperties reportedProperties; - - /* - * Provisioning state of edgeDevice resource - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of HciEdgeDeviceProperties class. - */ - public HciEdgeDeviceProperties() { - } - - /** - * Get the reportedProperties property: The instance view of all current configurations on HCI device. - * - * @return the reportedProperties value. - */ - public HciReportedProperties reportedProperties() { - return this.reportedProperties; - } - - /** - * Get the provisioningState property: Provisioning state of edgeDevice resource. - * - * @return the provisioningState value. - */ - @Override - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public HciEdgeDeviceProperties withDeviceConfiguration(DeviceConfiguration deviceConfiguration) { - super.withDeviceConfiguration(deviceConfiguration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (reportedProperties() != null) { - reportedProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("deviceConfiguration", deviceConfiguration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceProperties. - */ - public static HciEdgeDeviceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceProperties deserializedHciEdgeDeviceProperties = new HciEdgeDeviceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceConfiguration".equals(fieldName)) { - deserializedHciEdgeDeviceProperties.withDeviceConfiguration(DeviceConfiguration.fromJson(reader)); - } else if ("provisioningState".equals(fieldName)) { - deserializedHciEdgeDeviceProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("reportedProperties".equals(fieldName)) { - deserializedHciEdgeDeviceProperties.reportedProperties = HciReportedProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageAdapterIpInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageAdapterIpInfo.java deleted file mode 100644 index abf3682bf06a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageAdapterIpInfo.java +++ /dev/null @@ -1,116 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The StorageAdapter physical nodes of a cluster. - */ -@Immutable -public final class HciEdgeDeviceStorageAdapterIpInfo implements JsonSerializable { - /* - * storage adapter physical node name. - */ - private String physicalNode; - - /* - * The IPv4 address assigned to each storage adapter physical node on your Azure Stack HCI cluster. - */ - private String ipv4Address; - - /* - * The SubnetMask address assigned to each storage adapter physical node on your Azure Stack HCI cluster. - */ - private String subnetMask; - - /** - * Creates an instance of HciEdgeDeviceStorageAdapterIpInfo class. - */ - public HciEdgeDeviceStorageAdapterIpInfo() { - } - - /** - * Get the physicalNode property: storage adapter physical node name. - * - * @return the physicalNode value. - */ - public String physicalNode() { - return this.physicalNode; - } - - /** - * Get the ipv4Address property: The IPv4 address assigned to each storage adapter physical node on your Azure Stack - * HCI cluster. - * - * @return the ipv4Address value. - */ - public String ipv4Address() { - return this.ipv4Address; - } - - /** - * Get the subnetMask property: The SubnetMask address assigned to each storage adapter physical node on your Azure - * Stack HCI cluster. - * - * @return the subnetMask value. - */ - public String subnetMask() { - return this.subnetMask; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceStorageAdapterIpInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceStorageAdapterIpInfo if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceStorageAdapterIpInfo. - */ - public static HciEdgeDeviceStorageAdapterIpInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceStorageAdapterIpInfo deserializedHciEdgeDeviceStorageAdapterIpInfo - = new HciEdgeDeviceStorageAdapterIpInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("physicalNode".equals(fieldName)) { - deserializedHciEdgeDeviceStorageAdapterIpInfo.physicalNode = reader.getString(); - } else if ("ipv4Address".equals(fieldName)) { - deserializedHciEdgeDeviceStorageAdapterIpInfo.ipv4Address = reader.getString(); - } else if ("subnetMask".equals(fieldName)) { - deserializedHciEdgeDeviceStorageAdapterIpInfo.subnetMask = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceStorageAdapterIpInfo; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageNetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageNetworks.java deleted file mode 100644 index 73798488d0a3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceStorageNetworks.java +++ /dev/null @@ -1,138 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The StorageNetworks of a cluster. - */ -@Immutable -public final class HciEdgeDeviceStorageNetworks implements JsonSerializable { - /* - * Name of the storage network. - */ - private String name; - - /* - * Name of the storage network adapter. - */ - private String networkAdapterName; - - /* - * ID specified for the VLAN storage network. This setting is applied to the network interfaces that route the - * storage and VM migration traffic. - */ - private String storageVlanId; - - /* - * List of Storage adapter physical nodes config to deploy AzureStackHCI Cluster. - */ - private List storageAdapterIpInfo; - - /** - * Creates an instance of HciEdgeDeviceStorageNetworks class. - */ - public HciEdgeDeviceStorageNetworks() { - } - - /** - * Get the name property: Name of the storage network. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the networkAdapterName property: Name of the storage network adapter. - * - * @return the networkAdapterName value. - */ - public String networkAdapterName() { - return this.networkAdapterName; - } - - /** - * Get the storageVlanId property: ID specified for the VLAN storage network. This setting is applied to the network - * interfaces that route the storage and VM migration traffic. - * - * @return the storageVlanId value. - */ - public String storageVlanId() { - return this.storageVlanId; - } - - /** - * Get the storageAdapterIpInfo property: List of Storage adapter physical nodes config to deploy AzureStackHCI - * Cluster. - * - * @return the storageAdapterIpInfo value. - */ - public List storageAdapterIpInfo() { - return this.storageAdapterIpInfo; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageAdapterIpInfo() != null) { - storageAdapterIpInfo().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceStorageNetworks from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceStorageNetworks if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceStorageNetworks. - */ - public static HciEdgeDeviceStorageNetworks fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceStorageNetworks deserializedHciEdgeDeviceStorageNetworks = new HciEdgeDeviceStorageNetworks(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedHciEdgeDeviceStorageNetworks.name = reader.getString(); - } else if ("networkAdapterName".equals(fieldName)) { - deserializedHciEdgeDeviceStorageNetworks.networkAdapterName = reader.getString(); - } else if ("storageVlanId".equals(fieldName)) { - deserializedHciEdgeDeviceStorageNetworks.storageVlanId = reader.getString(); - } else if ("storageAdapterIPInfo".equals(fieldName)) { - List storageAdapterIpInfo - = reader.readArray(reader1 -> HciEdgeDeviceStorageAdapterIpInfo.fromJson(reader1)); - deserializedHciEdgeDeviceStorageNetworks.storageAdapterIpInfo = storageAdapterIpInfo; - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceStorageNetworks; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceVirtualSwitchConfigurationOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceVirtualSwitchConfigurationOverrides.java deleted file mode 100644 index 7f7b247998b0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciEdgeDeviceVirtualSwitchConfigurationOverrides.java +++ /dev/null @@ -1,100 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The VirtualSwitchConfigurationOverrides of a cluster. - */ -@Immutable -public final class HciEdgeDeviceVirtualSwitchConfigurationOverrides - implements JsonSerializable { - /* - * Enable IoV for Virtual Switch - */ - private String enableIov; - - /* - * Load Balancing Algorithm for Virtual Switch - */ - private String loadBalancingAlgorithm; - - /** - * Creates an instance of HciEdgeDeviceVirtualSwitchConfigurationOverrides class. - */ - public HciEdgeDeviceVirtualSwitchConfigurationOverrides() { - } - - /** - * Get the enableIov property: Enable IoV for Virtual Switch. - * - * @return the enableIov value. - */ - public String enableIov() { - return this.enableIov; - } - - /** - * Get the loadBalancingAlgorithm property: Load Balancing Algorithm for Virtual Switch. - * - * @return the loadBalancingAlgorithm value. - */ - public String loadBalancingAlgorithm() { - return this.loadBalancingAlgorithm; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciEdgeDeviceVirtualSwitchConfigurationOverrides from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciEdgeDeviceVirtualSwitchConfigurationOverrides if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciEdgeDeviceVirtualSwitchConfigurationOverrides. - */ - public static HciEdgeDeviceVirtualSwitchConfigurationOverrides fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciEdgeDeviceVirtualSwitchConfigurationOverrides deserializedHciEdgeDeviceVirtualSwitchConfigurationOverrides - = new HciEdgeDeviceVirtualSwitchConfigurationOverrides(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enableIov".equals(fieldName)) { - deserializedHciEdgeDeviceVirtualSwitchConfigurationOverrides.enableIov = reader.getString(); - } else if ("loadBalancingAlgorithm".equals(fieldName)) { - deserializedHciEdgeDeviceVirtualSwitchConfigurationOverrides.loadBalancingAlgorithm - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHciEdgeDeviceVirtualSwitchConfigurationOverrides; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNetworkProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNetworkProfile.java deleted file mode 100644 index 07da0ce1c6b3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNetworkProfile.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The network profile of a device. - */ -@Immutable -public final class HciNetworkProfile implements JsonSerializable { - /* - * List of NIC Details of device. - */ - private List nicDetails; - - /* - * List of switch details for edge device. - */ - private List switchDetails; - - /* - * HostNetwork config to deploy AzureStackHCI Cluster. - */ - private HciEdgeDeviceHostNetwork hostNetwork; - - /** - * Creates an instance of HciNetworkProfile class. - */ - public HciNetworkProfile() { - } - - /** - * Get the nicDetails property: List of NIC Details of device. - * - * @return the nicDetails value. - */ - public List nicDetails() { - return this.nicDetails; - } - - /** - * Get the switchDetails property: List of switch details for edge device. - * - * @return the switchDetails value. - */ - public List switchDetails() { - return this.switchDetails; - } - - /** - * Get the hostNetwork property: HostNetwork config to deploy AzureStackHCI Cluster. - * - * @return the hostNetwork value. - */ - public HciEdgeDeviceHostNetwork hostNetwork() { - return this.hostNetwork; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (nicDetails() != null) { - nicDetails().forEach(e -> e.validate()); - } - if (switchDetails() != null) { - switchDetails().forEach(e -> e.validate()); - } - if (hostNetwork() != null) { - hostNetwork().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciNetworkProfile from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciNetworkProfile if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the HciNetworkProfile. - */ - public static HciNetworkProfile fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciNetworkProfile deserializedHciNetworkProfile = new HciNetworkProfile(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nicDetails".equals(fieldName)) { - List nicDetails = reader.readArray(reader1 -> HciNicDetail.fromJson(reader1)); - deserializedHciNetworkProfile.nicDetails = nicDetails; - } else if ("switchDetails".equals(fieldName)) { - List switchDetails = reader.readArray(reader1 -> SwitchDetail.fromJson(reader1)); - deserializedHciNetworkProfile.switchDetails = switchDetails; - } else if ("hostNetwork".equals(fieldName)) { - deserializedHciNetworkProfile.hostNetwork = HciEdgeDeviceHostNetwork.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHciNetworkProfile; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNicDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNicDetail.java deleted file mode 100644 index 50e379e1a0ca..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciNicDetail.java +++ /dev/null @@ -1,307 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The NIC Detail of a device. - */ -@Immutable -public final class HciNicDetail implements JsonSerializable { - /* - * Adapter Name of NIC - */ - private String adapterName; - - /* - * Interface Description of NIC - */ - private String interfaceDescription; - - /* - * Component Id of NIC - */ - private String componentId; - - /* - * Driver Version of NIC - */ - private String driverVersion; - - /* - * Subnet Mask of NIC - */ - private String ip4Address; - - /* - * Subnet Mask of NIC - */ - private String subnetMask; - - /* - * Default Gateway of NIC - */ - private String defaultGateway; - - /* - * DNS Servers for NIC - */ - private List dnsServers; - - /* - * Default Isolation of Management NIC - */ - private String defaultIsolationId; - - /* - * MAC address information of NIC. - */ - private String macAddress; - - /* - * The slot attached to the NIC. - */ - private String slot; - - /* - * The switch attached to the NIC, if any. - */ - private String switchName; - - /* - * The type of NIC, physical, virtual, management. - */ - private String nicType; - - /* - * The VLAN ID of the physical NIC. - */ - private String vlanId; - - /* - * The status of NIC, up, disconnected. - */ - private String nicStatus; - - /** - * Creates an instance of HciNicDetail class. - */ - public HciNicDetail() { - } - - /** - * Get the adapterName property: Adapter Name of NIC. - * - * @return the adapterName value. - */ - public String adapterName() { - return this.adapterName; - } - - /** - * Get the interfaceDescription property: Interface Description of NIC. - * - * @return the interfaceDescription value. - */ - public String interfaceDescription() { - return this.interfaceDescription; - } - - /** - * Get the componentId property: Component Id of NIC. - * - * @return the componentId value. - */ - public String componentId() { - return this.componentId; - } - - /** - * Get the driverVersion property: Driver Version of NIC. - * - * @return the driverVersion value. - */ - public String driverVersion() { - return this.driverVersion; - } - - /** - * Get the ip4Address property: Subnet Mask of NIC. - * - * @return the ip4Address value. - */ - public String ip4Address() { - return this.ip4Address; - } - - /** - * Get the subnetMask property: Subnet Mask of NIC. - * - * @return the subnetMask value. - */ - public String subnetMask() { - return this.subnetMask; - } - - /** - * Get the defaultGateway property: Default Gateway of NIC. - * - * @return the defaultGateway value. - */ - public String defaultGateway() { - return this.defaultGateway; - } - - /** - * Get the dnsServers property: DNS Servers for NIC. - * - * @return the dnsServers value. - */ - public List dnsServers() { - return this.dnsServers; - } - - /** - * Get the defaultIsolationId property: Default Isolation of Management NIC. - * - * @return the defaultIsolationId value. - */ - public String defaultIsolationId() { - return this.defaultIsolationId; - } - - /** - * Get the macAddress property: MAC address information of NIC. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Get the slot property: The slot attached to the NIC. - * - * @return the slot value. - */ - public String slot() { - return this.slot; - } - - /** - * Get the switchName property: The switch attached to the NIC, if any. - * - * @return the switchName value. - */ - public String switchName() { - return this.switchName; - } - - /** - * Get the nicType property: The type of NIC, physical, virtual, management. - * - * @return the nicType value. - */ - public String nicType() { - return this.nicType; - } - - /** - * Get the vlanId property: The VLAN ID of the physical NIC. - * - * @return the vlanId value. - */ - public String vlanId() { - return this.vlanId; - } - - /** - * Get the nicStatus property: The status of NIC, up, disconnected. - * - * @return the nicStatus value. - */ - public String nicStatus() { - return this.nicStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciNicDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciNicDetail if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the HciNicDetail. - */ - public static HciNicDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciNicDetail deserializedHciNicDetail = new HciNicDetail(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("adapterName".equals(fieldName)) { - deserializedHciNicDetail.adapterName = reader.getString(); - } else if ("interfaceDescription".equals(fieldName)) { - deserializedHciNicDetail.interfaceDescription = reader.getString(); - } else if ("componentId".equals(fieldName)) { - deserializedHciNicDetail.componentId = reader.getString(); - } else if ("driverVersion".equals(fieldName)) { - deserializedHciNicDetail.driverVersion = reader.getString(); - } else if ("ip4Address".equals(fieldName)) { - deserializedHciNicDetail.ip4Address = reader.getString(); - } else if ("subnetMask".equals(fieldName)) { - deserializedHciNicDetail.subnetMask = reader.getString(); - } else if ("defaultGateway".equals(fieldName)) { - deserializedHciNicDetail.defaultGateway = reader.getString(); - } else if ("dnsServers".equals(fieldName)) { - List dnsServers = reader.readArray(reader1 -> reader1.getString()); - deserializedHciNicDetail.dnsServers = dnsServers; - } else if ("defaultIsolationId".equals(fieldName)) { - deserializedHciNicDetail.defaultIsolationId = reader.getString(); - } else if ("macAddress".equals(fieldName)) { - deserializedHciNicDetail.macAddress = reader.getString(); - } else if ("slot".equals(fieldName)) { - deserializedHciNicDetail.slot = reader.getString(); - } else if ("switchName".equals(fieldName)) { - deserializedHciNicDetail.switchName = reader.getString(); - } else if ("nicType".equals(fieldName)) { - deserializedHciNicDetail.nicType = reader.getString(); - } else if ("vlanId".equals(fieldName)) { - deserializedHciNicDetail.vlanId = reader.getString(); - } else if ("nicStatus".equals(fieldName)) { - deserializedHciNicDetail.nicStatus = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHciNicDetail; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciOsProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciOsProfile.java deleted file mode 100644 index 5834b66d3046..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciOsProfile.java +++ /dev/null @@ -1,97 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * OS configurations for HCI device. - */ -@Immutable -public final class HciOsProfile implements JsonSerializable { - /* - * The boot type of the device. e.g. UEFI, Legacy etc - */ - private String bootType; - - /* - * Version of assembly present on device - */ - private String assemblyVersion; - - /** - * Creates an instance of HciOsProfile class. - */ - public HciOsProfile() { - } - - /** - * Get the bootType property: The boot type of the device. e.g. UEFI, Legacy etc. - * - * @return the bootType value. - */ - public String bootType() { - return this.bootType; - } - - /** - * Get the assemblyVersion property: Version of assembly present on device. - * - * @return the assemblyVersion value. - */ - public String assemblyVersion() { - return this.assemblyVersion; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciOsProfile from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciOsProfile if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the HciOsProfile. - */ - public static HciOsProfile fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciOsProfile deserializedHciOsProfile = new HciOsProfile(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("bootType".equals(fieldName)) { - deserializedHciOsProfile.bootType = reader.getString(); - } else if ("assemblyVersion".equals(fieldName)) { - deserializedHciOsProfile.assemblyVersion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHciOsProfile; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciReportedProperties.java deleted file mode 100644 index 216517f4c625..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciReportedProperties.java +++ /dev/null @@ -1,158 +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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The device Configuration for HCI device. - */ -@Immutable -public final class HciReportedProperties extends ReportedProperties { - /* - * HCI device network information. - */ - private HciNetworkProfile networkProfile; - - /* - * HCI device OS specific information. - */ - private HciOsProfile osProfile; - - /* - * Solution builder extension (SBE) deployment package information. - */ - private SbeDeploymentPackageInfo sbeDeploymentPackageInfo; - - /* - * edge device state. - */ - private DeviceState deviceState; - - /* - * Extensions details for edge device. - */ - private ExtensionProfile extensionProfile; - - /** - * Creates an instance of HciReportedProperties class. - */ - public HciReportedProperties() { - } - - /** - * Get the networkProfile property: HCI device network information. - * - * @return the networkProfile value. - */ - public HciNetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Get the osProfile property: HCI device OS specific information. - * - * @return the osProfile value. - */ - public HciOsProfile osProfile() { - return this.osProfile; - } - - /** - * Get the sbeDeploymentPackageInfo property: Solution builder extension (SBE) deployment package information. - * - * @return the sbeDeploymentPackageInfo value. - */ - public SbeDeploymentPackageInfo sbeDeploymentPackageInfo() { - return this.sbeDeploymentPackageInfo; - } - - /** - * Get the deviceState property: edge device state. - * - * @return the deviceState value. - */ - @Override - public DeviceState deviceState() { - return this.deviceState; - } - - /** - * Get the extensionProfile property: Extensions details for edge device. - * - * @return the extensionProfile value. - */ - @Override - public ExtensionProfile extensionProfile() { - return this.extensionProfile; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (networkProfile() != null) { - networkProfile().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (sbeDeploymentPackageInfo() != null) { - sbeDeploymentPackageInfo().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HciReportedProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HciReportedProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the HciReportedProperties. - */ - public static HciReportedProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HciReportedProperties deserializedHciReportedProperties = new HciReportedProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceState".equals(fieldName)) { - deserializedHciReportedProperties.deviceState = DeviceState.fromString(reader.getString()); - } else if ("extensionProfile".equals(fieldName)) { - deserializedHciReportedProperties.extensionProfile = ExtensionProfile.fromJson(reader); - } else if ("networkProfile".equals(fieldName)) { - deserializedHciReportedProperties.networkProfile = HciNetworkProfile.fromJson(reader); - } else if ("osProfile".equals(fieldName)) { - deserializedHciReportedProperties.osProfile = HciOsProfile.fromJson(reader); - } else if ("sbeDeploymentPackageInfo".equals(fieldName)) { - deserializedHciReportedProperties.sbeDeploymentPackageInfo - = SbeDeploymentPackageInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHciReportedProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java index fa38d4bfa313..928464cf71b8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java @@ -71,13 +71,6 @@ public interface HciUpdate { */ String description(); - /** - * Gets the minSbeVersionRequired property: Minimum Sbe Version of the update. - * - * @return the minSbeVersionRequired value. - */ - String minSbeVersionRequired(); - /** * Gets the state property: State of the update as it relates to this stamp. * @@ -274,9 +267,8 @@ interface WithParentResource { * The stage of the HciUpdate 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.WithLocation, DefinitionStages.WithInstalledDate, DefinitionStages.WithDescription, - DefinitionStages.WithMinSbeVersionRequired, DefinitionStages.WithState, DefinitionStages.WithPrerequisites, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithInstalledDate, + DefinitionStages.WithDescription, DefinitionStages.WithState, DefinitionStages.WithPrerequisites, DefinitionStages.WithComponentVersions, DefinitionStages.WithRebootRequired, DefinitionStages.WithHealthState, DefinitionStages.WithHealthCheckResult, DefinitionStages.WithHealthCheckDate, DefinitionStages.WithPackagePath, @@ -347,19 +339,6 @@ interface WithDescription { WithCreate withDescription(String description); } - /** - * The stage of the HciUpdate definition allowing to specify minSbeVersionRequired. - */ - interface WithMinSbeVersionRequired { - /** - * Specifies the minSbeVersionRequired property: Minimum Sbe Version of the update.. - * - * @param minSbeVersionRequired Minimum Sbe Version of the update. - * @return the next definition stage. - */ - WithCreate withMinSbeVersionRequired(String minSbeVersionRequired); - } - /** * The stage of the HciUpdate definition allowing to specify state. */ @@ -620,14 +599,13 @@ interface WithNotifyMessage { /** * The template for HciUpdate update. */ - interface Update - extends UpdateStages.WithInstalledDate, UpdateStages.WithDescription, UpdateStages.WithMinSbeVersionRequired, - UpdateStages.WithState, UpdateStages.WithPrerequisites, UpdateStages.WithComponentVersions, - UpdateStages.WithRebootRequired, UpdateStages.WithHealthState, UpdateStages.WithHealthCheckResult, - UpdateStages.WithHealthCheckDate, UpdateStages.WithPackagePath, UpdateStages.WithPackageSizeInMb, - UpdateStages.WithDisplayName, UpdateStages.WithVersion, UpdateStages.WithPublisher, - UpdateStages.WithReleaseLink, UpdateStages.WithAvailabilityType, UpdateStages.WithPackageType, - UpdateStages.WithAdditionalProperties, UpdateStages.WithProgressPercentage, UpdateStages.WithNotifyMessage { + interface Update extends UpdateStages.WithInstalledDate, UpdateStages.WithDescription, UpdateStages.WithState, + UpdateStages.WithPrerequisites, UpdateStages.WithComponentVersions, UpdateStages.WithRebootRequired, + UpdateStages.WithHealthState, UpdateStages.WithHealthCheckResult, UpdateStages.WithHealthCheckDate, + UpdateStages.WithPackagePath, UpdateStages.WithPackageSizeInMb, UpdateStages.WithDisplayName, + UpdateStages.WithVersion, UpdateStages.WithPublisher, UpdateStages.WithReleaseLink, + UpdateStages.WithAvailabilityType, UpdateStages.WithPackageType, UpdateStages.WithAdditionalProperties, + UpdateStages.WithProgressPercentage, UpdateStages.WithNotifyMessage { /** * Executes the update request. * @@ -674,19 +652,6 @@ interface WithDescription { Update withDescription(String description); } - /** - * The stage of the HciUpdate update allowing to specify minSbeVersionRequired. - */ - interface WithMinSbeVersionRequired { - /** - * Specifies the minSbeVersionRequired property: Minimum Sbe Version of the update.. - * - * @param minSbeVersionRequired Minimum Sbe Version of the update. - * @return the next definition stage. - */ - Update withMinSbeVersionRequired(String minSbeVersionRequired); - } - /** * The stage of the HciUpdate update allowing to specify state. */ diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingHostNetwork.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.java similarity index 69% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingHostNetwork.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.java index d7290c5d99f0..92b2b7e0f65a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingHostNetwork.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.java @@ -16,17 +16,17 @@ * The HostNetwork of a cluster. */ @Fluent -public final class DeploymentSettingHostNetwork implements JsonSerializable { +public final class HostNetwork implements JsonSerializable { /* * The network intents assigned to the network reference pattern used for the deployment. Each intent will define * its own name, traffic type, adapter names, and overrides as recommended by your OEM. */ - private List intents; + private List intents; /* * List of StorageNetworks config to deploy AzureStackHCI Cluster. */ - private List storageNetworks; + private List storageNetworks; /* * Defines how the storage adapters between nodes are connected either switch or switch less.. @@ -40,9 +40,9 @@ public final class DeploymentSettingHostNetwork implements JsonSerializable intents() { + public List intents() { return this.intents; } @@ -60,9 +60,9 @@ public List intents() { * Each intent will define its own name, traffic type, adapter names, and overrides as recommended by your OEM. * * @param intents the intents value to set. - * @return the DeploymentSettingHostNetwork object itself. + * @return the HostNetwork object itself. */ - public DeploymentSettingHostNetwork withIntents(List intents) { + public HostNetwork withIntents(List intents) { this.intents = intents; return this; } @@ -72,7 +72,7 @@ public DeploymentSettingHostNetwork withIntents(List i * * @return the storageNetworks value. */ - public List storageNetworks() { + public List storageNetworks() { return this.storageNetworks; } @@ -80,9 +80,9 @@ public List storageNetworks() { * Set the storageNetworks property: List of StorageNetworks config to deploy AzureStackHCI Cluster. * * @param storageNetworks the storageNetworks value to set. - * @return the DeploymentSettingHostNetwork object itself. + * @return the HostNetwork object itself. */ - public DeploymentSettingHostNetwork withStorageNetworks(List storageNetworks) { + public HostNetwork withStorageNetworks(List storageNetworks) { this.storageNetworks = storageNetworks; return this; } @@ -102,9 +102,9 @@ public Boolean storageConnectivitySwitchless() { * either switch or switch less.. * * @param storageConnectivitySwitchless the storageConnectivitySwitchless value to set. - * @return the DeploymentSettingHostNetwork object itself. + * @return the HostNetwork object itself. */ - public DeploymentSettingHostNetwork withStorageConnectivitySwitchless(Boolean storageConnectivitySwitchless) { + public HostNetwork withStorageConnectivitySwitchless(Boolean storageConnectivitySwitchless) { this.storageConnectivitySwitchless = storageConnectivitySwitchless; return this; } @@ -126,9 +126,9 @@ public Boolean enableStorageAutoIp() { * automatically. * * @param enableStorageAutoIp the enableStorageAutoIp value to set. - * @return the DeploymentSettingHostNetwork object itself. + * @return the HostNetwork object itself. */ - public DeploymentSettingHostNetwork withEnableStorageAutoIp(Boolean enableStorageAutoIp) { + public HostNetwork withEnableStorageAutoIp(Boolean enableStorageAutoIp) { this.enableStorageAutoIp = enableStorageAutoIp; return this; } @@ -162,40 +162,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of DeploymentSettingHostNetwork from the JsonReader. + * Reads an instance of HostNetwork from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingHostNetwork if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingHostNetwork. + * @return An instance of HostNetwork if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostNetwork. */ - public static DeploymentSettingHostNetwork fromJson(JsonReader jsonReader) throws IOException { + public static HostNetwork fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - DeploymentSettingHostNetwork deserializedDeploymentSettingHostNetwork = new DeploymentSettingHostNetwork(); + HostNetwork deserializedHostNetwork = new HostNetwork(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("intents".equals(fieldName)) { - List intents - = reader.readArray(reader1 -> DeploymentSettingIntents.fromJson(reader1)); - deserializedDeploymentSettingHostNetwork.intents = intents; + List intents = reader.readArray(reader1 -> Intents.fromJson(reader1)); + deserializedHostNetwork.intents = intents; } else if ("storageNetworks".equals(fieldName)) { - List storageNetworks - = reader.readArray(reader1 -> DeploymentSettingStorageNetworks.fromJson(reader1)); - deserializedDeploymentSettingHostNetwork.storageNetworks = storageNetworks; + List storageNetworks + = reader.readArray(reader1 -> StorageNetworks.fromJson(reader1)); + deserializedHostNetwork.storageNetworks = storageNetworks; } else if ("storageConnectivitySwitchless".equals(fieldName)) { - deserializedDeploymentSettingHostNetwork.storageConnectivitySwitchless - = reader.getNullable(JsonReader::getBoolean); + deserializedHostNetwork.storageConnectivitySwitchless = reader.getNullable(JsonReader::getBoolean); } else if ("enableStorageAutoIp".equals(fieldName)) { - deserializedDeploymentSettingHostNetwork.enableStorageAutoIp - = reader.getNullable(JsonReader::getBoolean); + deserializedHostNetwork.enableStorageAutoIp = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } } - return deserializedDeploymentSettingHostNetwork; + return deserializedHostNetwork; }); } } 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 000000000000..2dadf3af7919 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HttpProxyConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * HTTP Proxy configuration for the VM. + */ +@Fluent +public final class HttpProxyConfiguration implements JsonSerializable { + /* + * The HTTP proxy server endpoint to use. + */ + private String httpProxy; + + /* + * The HTTPS proxy server endpoint to use. + */ + private String httpsProxy; + + /* + * The endpoints that should not go through proxy. + */ + private List noProxy; + + /* + * Alternative CA cert to use for connecting to proxy servers. + */ + private String trustedCa; + + /** + * Creates an instance of HttpProxyConfiguration class. + */ + public HttpProxyConfiguration() { + } + + /** + * Get the httpProxy property: The HTTP proxy server endpoint to use. + * + * @return the httpProxy value. + */ + public String httpProxy() { + return this.httpProxy; + } + + /** + * Set the httpProxy property: The HTTP proxy server endpoint to use. + * + * @param httpProxy the httpProxy value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withHttpProxy(String httpProxy) { + this.httpProxy = httpProxy; + return this; + } + + /** + * Get the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @return the httpsProxy value. + */ + public String httpsProxy() { + return this.httpsProxy; + } + + /** + * Set the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @param httpsProxy the httpsProxy value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withHttpsProxy(String httpsProxy) { + this.httpsProxy = httpsProxy; + return this; + } + + /** + * Get the noProxy property: The endpoints that should not go through proxy. + * + * @return the noProxy value. + */ + public List noProxy() { + return this.noProxy; + } + + /** + * Set the noProxy property: The endpoints that should not go through proxy. + * + * @param noProxy the noProxy value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withNoProxy(List noProxy) { + this.noProxy = noProxy; + return this; + } + + /** + * Get the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @return the trustedCa value. + */ + public String trustedCa() { + return this.trustedCa; + } + + /** + * Set the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @param trustedCa the trustedCa value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withTrustedCa(String trustedCa) { + this.trustedCa = trustedCa; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("httpProxy", this.httpProxy); + jsonWriter.writeStringField("httpsProxy", this.httpsProxy); + jsonWriter.writeArrayField("noProxy", this.noProxy, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("trustedCa", this.trustedCa); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpProxyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpProxyConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpProxyConfiguration. + */ + public static HttpProxyConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpProxyConfiguration deserializedHttpProxyConfiguration = new HttpProxyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpProxy".equals(fieldName)) { + deserializedHttpProxyConfiguration.httpProxy = reader.getString(); + } else if ("httpsProxy".equals(fieldName)) { + deserializedHttpProxyConfiguration.httpsProxy = reader.getString(); + } else if ("noProxy".equals(fieldName)) { + List noProxy = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpProxyConfiguration.noProxy = noProxy; + } else if ("trustedCa".equals(fieldName)) { + deserializedHttpProxyConfiguration.trustedCa = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpProxyConfiguration; + }); + } +} 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 000000000000..4f776773bee0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadata.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.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 000000000000..bacb0bdfa7b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadataList.java @@ -0,0 +1,136 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; +import java.io.IOException; +import java.util.List; + +/** + * List of HybridIdentityMetadata. + */ +@Fluent +public final class HybridIdentityMetadataList implements JsonSerializable { + /* + * Url to follow for getting next page of HybridIdentityMetadata. + */ + private String nextLink; + + /* + * Array of HybridIdentityMetadata + */ + 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.atError() + .log(new IllegalArgumentException( + "Missing required property value in model HybridIdentityMetadataList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HybridIdentityMetadataList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HybridIdentityMetadataList if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HybridIdentityMetadataList. + */ + public static HybridIdentityMetadataList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HybridIdentityMetadataList deserializedHybridIdentityMetadataList = new HybridIdentityMetadataList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HybridIdentityMetadataInner.fromJson(reader1)); + deserializedHybridIdentityMetadataList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHybridIdentityMetadataList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHybridIdentityMetadataList; + }); + } +} 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 000000000000..f824e6f7fe03 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HybridIdentityMetadatas.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 000000000000..f560c362399b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HyperVGeneration.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.util.ExpandableStringEnum; +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. + */ + 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 000000000000..c593acc3405b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Identity.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identity for the resource. + */ +@Fluent +public final class Identity implements JsonSerializable { + /* + * The principal ID of resource identity. + */ + private String principalId; + + /* + * The tenant ID of resource. + */ + private String tenantId; + + /* + * The identity 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} 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 000000000000..da1db2eb9199 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InstanceViewStatus.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Instance view status. + */ +@Fluent +public final class InstanceViewStatus implements JsonSerializable { + /* + * The status code. + */ + private String code; + + /* + * The level code. + */ + private StatusLevelTypes level; + + /* + * The short localizable label for the status. + */ + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + private String message; + + /* + * The time of the status. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString()); + jsonWriter.writeStringField("displayStatus", this.displayStatus); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("time", + this.time == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.time)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceViewStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceViewStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceViewStatus. + */ + public static InstanceViewStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceViewStatus deserializedInstanceViewStatus = new InstanceViewStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedInstanceViewStatus.code = reader.getString(); + } else if ("level".equals(fieldName)) { + deserializedInstanceViewStatus.level = StatusLevelTypes.fromString(reader.getString()); + } else if ("displayStatus".equals(fieldName)) { + deserializedInstanceViewStatus.displayStatus = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedInstanceViewStatus.message = reader.getString(); + } else if ("time".equals(fieldName)) { + deserializedInstanceViewStatus.time = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceViewStatus; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingIntents.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Intents.java similarity index 72% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingIntents.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Intents.java index ea452bc49fe2..3a11ff2adb41 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingIntents.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Intents.java @@ -16,7 +16,7 @@ * The Intents of a cluster. */ @Fluent -public final class DeploymentSettingIntents implements JsonSerializable { +public final class Intents implements JsonSerializable { /* * Name of the network intent you wish to create. */ @@ -41,7 +41,7 @@ public final class DeploymentSettingIntents implements JsonSerializable trafficType() { * 'Management'. * * @param trafficType the trafficType value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withTrafficType(List trafficType) { + public Intents withTrafficType(List trafficType) { this.trafficType = trafficType; return this; } @@ -126,9 +126,9 @@ public List adapter() { * Set the adapter property: Array of network interfaces used for the network intent. * * @param adapter the adapter value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withAdapter(List adapter) { + public Intents withAdapter(List adapter) { this.adapter = adapter; return this; } @@ -148,9 +148,9 @@ public Boolean overrideVirtualSwitchConfiguration() { * guidance. Do not modify this parameter without OEM validation. * * @param overrideVirtualSwitchConfiguration the overrideVirtualSwitchConfiguration value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withOverrideVirtualSwitchConfiguration(Boolean overrideVirtualSwitchConfiguration) { + public Intents withOverrideVirtualSwitchConfiguration(Boolean overrideVirtualSwitchConfiguration) { this.overrideVirtualSwitchConfiguration = overrideVirtualSwitchConfiguration; return this; } @@ -160,7 +160,7 @@ public DeploymentSettingIntents withOverrideVirtualSwitchConfiguration(Boolean o * * @return the virtualSwitchConfigurationOverrides value. */ - public DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides() { + public VirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides() { return this.virtualSwitchConfigurationOverrides; } @@ -168,10 +168,10 @@ public DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigu * Set the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster. * * @param virtualSwitchConfigurationOverrides the virtualSwitchConfigurationOverrides value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withVirtualSwitchConfigurationOverrides( - DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides) { + public Intents withVirtualSwitchConfigurationOverrides( + VirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides) { this.virtualSwitchConfigurationOverrides = virtualSwitchConfigurationOverrides; return this; } @@ -191,9 +191,9 @@ public Boolean overrideQosPolicy() { * modify this parameter without OEM validation. * * @param overrideQosPolicy the overrideQosPolicy value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withOverrideQosPolicy(Boolean overrideQosPolicy) { + public Intents withOverrideQosPolicy(Boolean overrideQosPolicy) { this.overrideQosPolicy = overrideQosPolicy; return this; } @@ -211,9 +211,9 @@ public QosPolicyOverrides qosPolicyOverrides() { * Set the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster. * * @param qosPolicyOverrides the qosPolicyOverrides value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withQosPolicyOverrides(QosPolicyOverrides qosPolicyOverrides) { + public Intents withQosPolicyOverrides(QosPolicyOverrides qosPolicyOverrides) { this.qosPolicyOverrides = qosPolicyOverrides; return this; } @@ -233,9 +233,9 @@ public Boolean overrideAdapterProperty() { * not modify this parameter without OEM validation. * * @param overrideAdapterProperty the overrideAdapterProperty value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents withOverrideAdapterProperty(Boolean overrideAdapterProperty) { + public Intents withOverrideAdapterProperty(Boolean overrideAdapterProperty) { this.overrideAdapterProperty = overrideAdapterProperty; return this; } @@ -245,7 +245,7 @@ public DeploymentSettingIntents withOverrideAdapterProperty(Boolean overrideAdap * * @return the adapterPropertyOverrides value. */ - public DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides() { + public AdapterPropertyOverrides adapterPropertyOverrides() { return this.adapterPropertyOverrides; } @@ -253,10 +253,9 @@ public DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides() { * Set the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster. * * @param adapterPropertyOverrides the adapterPropertyOverrides value to set. - * @return the DeploymentSettingIntents object itself. + * @return the Intents object itself. */ - public DeploymentSettingIntents - withAdapterPropertyOverrides(DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides) { + public Intents withAdapterPropertyOverrides(AdapterPropertyOverrides adapterPropertyOverrides) { this.adapterPropertyOverrides = adapterPropertyOverrides; return this; } @@ -297,50 +296,47 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of DeploymentSettingIntents from the JsonReader. + * Reads an instance of Intents from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingIntents if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingIntents. + * @return An instance of Intents if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Intents. */ - public static DeploymentSettingIntents fromJson(JsonReader jsonReader) throws IOException { + public static Intents fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - DeploymentSettingIntents deserializedDeploymentSettingIntents = new DeploymentSettingIntents(); + Intents deserializedIntents = new Intents(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { - deserializedDeploymentSettingIntents.name = reader.getString(); + deserializedIntents.name = reader.getString(); } else if ("trafficType".equals(fieldName)) { List trafficType = reader.readArray(reader1 -> reader1.getString()); - deserializedDeploymentSettingIntents.trafficType = trafficType; + deserializedIntents.trafficType = trafficType; } else if ("adapter".equals(fieldName)) { List adapter = reader.readArray(reader1 -> reader1.getString()); - deserializedDeploymentSettingIntents.adapter = adapter; + deserializedIntents.adapter = adapter; } else if ("overrideVirtualSwitchConfiguration".equals(fieldName)) { - deserializedDeploymentSettingIntents.overrideVirtualSwitchConfiguration - = reader.getNullable(JsonReader::getBoolean); + deserializedIntents.overrideVirtualSwitchConfiguration = reader.getNullable(JsonReader::getBoolean); } else if ("virtualSwitchConfigurationOverrides".equals(fieldName)) { - deserializedDeploymentSettingIntents.virtualSwitchConfigurationOverrides - = DeploymentSettingVirtualSwitchConfigurationOverrides.fromJson(reader); + deserializedIntents.virtualSwitchConfigurationOverrides + = VirtualSwitchConfigurationOverrides.fromJson(reader); } else if ("overrideQosPolicy".equals(fieldName)) { - deserializedDeploymentSettingIntents.overrideQosPolicy = reader.getNullable(JsonReader::getBoolean); + deserializedIntents.overrideQosPolicy = reader.getNullable(JsonReader::getBoolean); } else if ("qosPolicyOverrides".equals(fieldName)) { - deserializedDeploymentSettingIntents.qosPolicyOverrides = QosPolicyOverrides.fromJson(reader); + deserializedIntents.qosPolicyOverrides = QosPolicyOverrides.fromJson(reader); } else if ("overrideAdapterProperty".equals(fieldName)) { - deserializedDeploymentSettingIntents.overrideAdapterProperty - = reader.getNullable(JsonReader::getBoolean); + deserializedIntents.overrideAdapterProperty = reader.getNullable(JsonReader::getBoolean); } else if ("adapterPropertyOverrides".equals(fieldName)) { - deserializedDeploymentSettingIntents.adapterPropertyOverrides - = DeploymentSettingAdapterPropertyOverrides.fromJson(reader); + deserializedIntents.adapterPropertyOverrides = AdapterPropertyOverrides.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedDeploymentSettingIntents; + return deserializedIntents; }); } } 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 000000000000..9d7b922c40c8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java @@ -0,0 +1,95 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The InterfaceDnsSettings model. + */ +@Fluent +public final class InterfaceDnsSettings implements JsonSerializable { + /* + * List of DNS server IP Addresses for the interface + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InterfaceDnsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InterfaceDnsSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InterfaceDnsSettings. + */ + public static InterfaceDnsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InterfaceDnsSettings deserializedInterfaceDnsSettings = new InterfaceDnsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedInterfaceDnsSettings.dnsServers = dnsServers; + } else { + reader.skipChildren(); + } + } + + return deserializedInterfaceDnsSettings; + }); + } +} 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 000000000000..58d99a41ecca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpAllocationMethodEnum.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.util.ExpandableStringEnum; +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. + */ + 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 000000000000..6d44550633a6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java @@ -0,0 +1,127 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * InterfaceIPConfiguration iPConfiguration in a network interface. + */ +@Fluent +public final class IpConfiguration implements JsonSerializable { + /* + * Name - The name of the resource that is unique within a resource group. This name can be used to access the + * resource. + */ + private String name; + + /* + * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfiguration. + */ + public static IpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfiguration deserializedIpConfiguration = new IpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpConfiguration.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIpConfiguration.properties = IpConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfiguration; + }); + } +} 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 000000000000..aac4f25d5808 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java @@ -0,0 +1,156 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + */ +@Fluent +public final class IpConfigurationProperties implements JsonSerializable { + /* + * Gateway for network interface + */ + private String gateway; + + /* + * prefixLength for network interface + */ + private String prefixLength; + + /* + * PrivateIPAddress - Private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * Subnet - Name of Subnet bound to the IP configuration. + */ + 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; + } + + /** + * Get the prefixLength property: prefixLength for network interface. + * + * @return the prefixLength value. + */ + public String prefixLength() { + return this.prefixLength; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeJsonField("subnet", this.subnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationProperties. + */ + public static IpConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationProperties deserializedIpConfigurationProperties = new IpConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gateway".equals(fieldName)) { + deserializedIpConfigurationProperties.gateway = reader.getString(); + } else if ("prefixLength".equals(fieldName)) { + deserializedIpConfigurationProperties.prefixLength = reader.getString(); + } else if ("privateIPAddress".equals(fieldName)) { + deserializedIpConfigurationProperties.privateIpAddress = reader.getString(); + } else if ("subnet".equals(fieldName)) { + deserializedIpConfigurationProperties.subnet = IpConfigurationPropertiesSubnet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationProperties; + }); + } +} 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 000000000000..ed04e6e637db --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Subnet - Name of Subnet bound to the IP configuration. + */ +@Fluent +public final class IpConfigurationPropertiesSubnet implements JsonSerializable { + /* + * ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationPropertiesSubnet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationPropertiesSubnet if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationPropertiesSubnet. + */ + public static IpConfigurationPropertiesSubnet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationPropertiesSubnet deserializedIpConfigurationPropertiesSubnet + = new IpConfigurationPropertiesSubnet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIpConfigurationPropertiesSubnet.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationPropertiesSubnet; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java new file mode 100644 index 000000000000..04231ea88859 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java @@ -0,0 +1,208 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The IpPool model. + */ +@Fluent +public final class IpPool implements JsonSerializable { + /* + * Name of the IP-Pool + */ + private String name; + + /* + * Type of the IP Pool [vm, vippool] + */ + private IpPoolTypeEnum ipPoolType; + + /* + * Start of the IP address pool + */ + private String start; + + /* + * End of the IP address pool + */ + private String end; + + /* + * The info property. + */ + private IpPoolInfo info; + + /** + * Creates an instance of IpPool class. + */ + public IpPool() { + } + + /** + * Get the name property: Name of the IP-Pool. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the IP-Pool. + * + * @param name the name value to set. + * @return the IpPool object itself. + */ + public IpPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ipPoolType property: Type of the IP Pool [vm, vippool]. + * + * @return the ipPoolType value. + */ + public IpPoolTypeEnum ipPoolType() { + return this.ipPoolType; + } + + /** + * Set the ipPoolType property: Type of the IP Pool [vm, vippool]. + * + * @param ipPoolType the ipPoolType value to set. + * @return the IpPool object itself. + */ + public IpPool withIpPoolType(IpPoolTypeEnum ipPoolType) { + this.ipPoolType = ipPoolType; + return this; + } + + /** + * Get the start property: Start of the IP address pool. + * + * @return the start value. + */ + public String start() { + return this.start; + } + + /** + * Set the start property: Start of the IP address pool. + * + * @param start the start value to set. + * @return the IpPool object itself. + */ + public IpPool withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the end property: End of the IP address pool. + * + * @return the end value. + */ + public String end() { + return this.end; + } + + /** + * Set the end property: End of the IP address pool. + * + * @param end the end value to set. + * @return the IpPool object itself. + */ + public IpPool withEnd(String end) { + this.end = end; + return this; + } + + /** + * Get the info property: The info property. + * + * @return the info value. + */ + public IpPoolInfo info() { + return this.info; + } + + /** + * Set the info property: The info property. + * + * @param info the info value to set. + * @return the IpPool object itself. + */ + public IpPool withInfo(IpPoolInfo info) { + this.info = info; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (info() != null) { + info().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("ipPoolType", this.ipPoolType == null ? null : this.ipPoolType.toString()); + jsonWriter.writeStringField("start", this.start); + jsonWriter.writeStringField("end", this.end); + jsonWriter.writeJsonField("info", this.info); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpPool if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpPool. + */ + public static IpPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpPool deserializedIpPool = new IpPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpPool.name = reader.getString(); + } else if ("ipPoolType".equals(fieldName)) { + deserializedIpPool.ipPoolType = IpPoolTypeEnum.fromString(reader.getString()); + } else if ("start".equals(fieldName)) { + deserializedIpPool.start = reader.getString(); + } else if ("end".equals(fieldName)) { + deserializedIpPool.end = reader.getString(); + } else if ("info".equals(fieldName)) { + deserializedIpPool.info = IpPoolInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIpPool; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.java new file mode 100644 index 000000000000..d13a6e12c515 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The IpPoolInfo model. + */ +@Immutable +public final class IpPoolInfo implements JsonSerializable { + /* + * Number of IP addresses allocated from the IP Pool + */ + private String used; + + /* + * Number of IP addresses available in the IP Pool + */ + private String available; + + /** + * Creates an instance of IpPoolInfo class. + */ + public IpPoolInfo() { + } + + /** + * Get the used property: Number of IP addresses allocated from the IP Pool. + * + * @return the used value. + */ + public String used() { + return this.used; + } + + /** + * Get the available property: Number of IP addresses available in the IP Pool. + * + * @return the available value. + */ + public String available() { + return this.available; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpPoolInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpPoolInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the IpPoolInfo. + */ + public static IpPoolInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpPoolInfo deserializedIpPoolInfo = new IpPoolInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("used".equals(fieldName)) { + deserializedIpPoolInfo.used = reader.getString(); + } else if ("available".equals(fieldName)) { + deserializedIpPoolInfo.available = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpPoolInfo; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.java new file mode 100644 index 000000000000..3ecda044e41f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.java @@ -0,0 +1,56 @@ +// Copyright (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; + +/** + * Type of the IP Pool [vm, vippool]. + */ +public enum IpPoolTypeEnum { + /** + * Enum value vm. + */ + VM("vm"), + + /** + * Enum value vippool. + */ + VIPPOOL("vippool"); + + /** + * The actual serialized value for a IpPoolTypeEnum instance. + */ + private final String value; + + IpPoolTypeEnum(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IpPoolTypeEnum instance. + * + * @param value the serialized value to parse. + * @return the parsed IpPoolTypeEnum object, or null if unable to parse. + */ + public static IpPoolTypeEnum fromString(String value) { + if (value == null) { + return null; + } + IpPoolTypeEnum[] items = IpPoolTypeEnum.values(); + for (IpPoolTypeEnum item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionError.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionError.java deleted file mode 100644 index a52bc6fad38e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionError.java +++ /dev/null @@ -1,97 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Log Collection Error details of the cluster. - */ -@Immutable -public final class LogCollectionError implements JsonSerializable { - /* - * Error Code of the log collection - */ - private String errorCode; - - /* - * Error Message of the log collection - */ - private String errorMessage; - - /** - * Creates an instance of LogCollectionError class. - */ - public LogCollectionError() { - } - - /** - * Get the errorCode property: Error Code of the log collection. - * - * @return the errorCode value. - */ - public String errorCode() { - return this.errorCode; - } - - /** - * Get the errorMessage property: Error Message of the log collection. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogCollectionError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogCollectionError if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogCollectionError. - */ - public static LogCollectionError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogCollectionError deserializedLogCollectionError = new LogCollectionError(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorCode".equals(fieldName)) { - deserializedLogCollectionError.errorCode = reader.getString(); - } else if ("errorMessage".equals(fieldName)) { - deserializedLogCollectionError.errorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogCollectionError; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionJobType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionJobType.java deleted file mode 100644 index 49b2153f9365..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionJobType.java +++ /dev/null @@ -1,51 +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 java.util.Collection; - -/** - * LogCollection job type. - */ -public final class LogCollectionJobType extends ExpandableStringEnum { - /** - * Static value OnDemand for LogCollectionJobType. - */ - public static final LogCollectionJobType ON_DEMAND = fromString("OnDemand"); - - /** - * Static value Scheduled for LogCollectionJobType. - */ - public static final LogCollectionJobType SCHEDULED = fromString("Scheduled"); - - /** - * Creates a new instance of LogCollectionJobType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public LogCollectionJobType() { - } - - /** - * Creates or finds a LogCollectionJobType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LogCollectionJobType. - */ - public static LogCollectionJobType fromString(String name) { - return fromString(name, LogCollectionJobType.class); - } - - /** - * Gets known LogCollectionJobType values. - * - * @return known LogCollectionJobType values. - */ - public static Collection values() { - return values(LogCollectionJobType.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionProperties.java deleted file mode 100644 index 411754355614..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionProperties.java +++ /dev/null @@ -1,140 +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.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Log Collection properties of the cluster. - */ -@Immutable -public final class LogCollectionProperties implements JsonSerializable { - /* - * From DateTimeStamp from when logs need to be connected - */ - private OffsetDateTime fromDate; - - /* - * To DateTimeStamp till when logs need to be connected - */ - private OffsetDateTime toDate; - - /* - * Recent DateTimeStamp where logs are successfully generated - */ - private OffsetDateTime lastLogGenerated; - - /* - * The logCollectionSessionDetails property. - */ - private List logCollectionSessionDetails; - - /** - * Creates an instance of LogCollectionProperties class. - */ - public LogCollectionProperties() { - } - - /** - * Get the fromDate property: From DateTimeStamp from when logs need to be connected. - * - * @return the fromDate value. - */ - public OffsetDateTime fromDate() { - return this.fromDate; - } - - /** - * Get the toDate property: To DateTimeStamp till when logs need to be connected. - * - * @return the toDate value. - */ - public OffsetDateTime toDate() { - return this.toDate; - } - - /** - * Get the lastLogGenerated property: Recent DateTimeStamp where logs are successfully generated. - * - * @return the lastLogGenerated value. - */ - public OffsetDateTime lastLogGenerated() { - return this.lastLogGenerated; - } - - /** - * Get the logCollectionSessionDetails property: The logCollectionSessionDetails property. - * - * @return the logCollectionSessionDetails value. - */ - public List logCollectionSessionDetails() { - return this.logCollectionSessionDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logCollectionSessionDetails() != null) { - logCollectionSessionDetails().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogCollectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogCollectionProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the LogCollectionProperties. - */ - public static LogCollectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogCollectionProperties deserializedLogCollectionProperties = new LogCollectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("fromDate".equals(fieldName)) { - deserializedLogCollectionProperties.fromDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("toDate".equals(fieldName)) { - deserializedLogCollectionProperties.toDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastLogGenerated".equals(fieldName)) { - deserializedLogCollectionProperties.lastLogGenerated = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("logCollectionSessionDetails".equals(fieldName)) { - List logCollectionSessionDetails - = reader.readArray(reader1 -> LogCollectionSession.fromJson(reader1)); - deserializedLogCollectionProperties.logCollectionSessionDetails = logCollectionSessionDetails; - } else { - reader.skipChildren(); - } - } - - return deserializedLogCollectionProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequest.java deleted file mode 100644 index 825ef6eee47d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequest.java +++ /dev/null @@ -1,96 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Log Collection Request. - */ -@Fluent -public final class LogCollectionRequest implements JsonSerializable { - /* - * Properties for Log Collection Request - */ - private LogCollectionRequestProperties properties; - - /** - * Creates an instance of LogCollectionRequest class. - */ - public LogCollectionRequest() { - } - - /** - * Get the properties property: Properties for Log Collection Request. - * - * @return the properties value. - */ - public LogCollectionRequestProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties for Log Collection Request. - * - * @param properties the properties value to set. - * @return the LogCollectionRequest object itself. - */ - public LogCollectionRequest withProperties(LogCollectionRequestProperties 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogCollectionRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogCollectionRequest if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the LogCollectionRequest. - */ - public static LogCollectionRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogCollectionRequest deserializedLogCollectionRequest = new LogCollectionRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedLogCollectionRequest.properties = LogCollectionRequestProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLogCollectionRequest; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequestProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequestProperties.java deleted file mode 100644 index 06b45cde7dc8..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionRequestProperties.java +++ /dev/null @@ -1,143 +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.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties for Log Collection Request. - */ -@Fluent -public final class LogCollectionRequestProperties implements JsonSerializable { - /* - * From DateTimeStamp from when logs need to be connected - */ - private OffsetDateTime fromDate; - - /* - * To DateTimeStamp till when logs need to be connected - */ - private OffsetDateTime toDate; - - /** - * Creates an instance of LogCollectionRequestProperties class. - */ - public LogCollectionRequestProperties() { - } - - /** - * Get the fromDate property: From DateTimeStamp from when logs need to be connected. - * - * @return the fromDate value. - */ - public OffsetDateTime fromDate() { - return this.fromDate; - } - - /** - * Set the fromDate property: From DateTimeStamp from when logs need to be connected. - * - * @param fromDate the fromDate value to set. - * @return the LogCollectionRequestProperties object itself. - */ - public LogCollectionRequestProperties withFromDate(OffsetDateTime fromDate) { - this.fromDate = fromDate; - return this; - } - - /** - * Get the toDate property: To DateTimeStamp till when logs need to be connected. - * - * @return the toDate value. - */ - public OffsetDateTime toDate() { - return this.toDate; - } - - /** - * Set the toDate property: To DateTimeStamp till when logs need to be connected. - * - * @param toDate the toDate value to set. - * @return the LogCollectionRequestProperties object itself. - */ - public LogCollectionRequestProperties withToDate(OffsetDateTime toDate) { - this.toDate = toDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (fromDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property fromDate in model LogCollectionRequestProperties")); - } - if (toDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property toDate in model LogCollectionRequestProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(LogCollectionRequestProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fromDate", - this.fromDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.fromDate)); - jsonWriter.writeStringField("toDate", - this.toDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.toDate)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogCollectionRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogCollectionRequestProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LogCollectionRequestProperties. - */ - public static LogCollectionRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogCollectionRequestProperties deserializedLogCollectionRequestProperties - = new LogCollectionRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("fromDate".equals(fieldName)) { - deserializedLogCollectionRequestProperties.fromDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("toDate".equals(fieldName)) { - deserializedLogCollectionRequestProperties.toDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedLogCollectionRequestProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionSession.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionSession.java deleted file mode 100644 index ca5c21616188..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionSession.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Log Collection Session details of the cluster. - */ -@Immutable -public final class LogCollectionSession implements JsonSerializable { - /* - * Start Time of the logs when it was collected - */ - private OffsetDateTime logStartTime; - - /* - * End Time of the logs when it was collected - */ - private OffsetDateTime logEndTime; - - /* - * Duration of logs collected - */ - private OffsetDateTime timeCollected; - - /* - * Size of the logs collected - */ - private Long logSize; - - /* - * LogCollection status - */ - private LogCollectionStatus logCollectionStatus; - - /* - * LogCollection job type - */ - private LogCollectionJobType logCollectionJobType; - - /* - * CorrelationId of the log collection - */ - private String correlationId; - - /* - * End Time of the logs when it was collected - */ - private OffsetDateTime endTimeCollected; - - /* - * Log Collection Error details of the cluster. - */ - private LogCollectionError logCollectionError; - - /** - * Creates an instance of LogCollectionSession class. - */ - public LogCollectionSession() { - } - - /** - * Get the logStartTime property: Start Time of the logs when it was collected. - * - * @return the logStartTime value. - */ - public OffsetDateTime logStartTime() { - return this.logStartTime; - } - - /** - * Get the logEndTime property: End Time of the logs when it was collected. - * - * @return the logEndTime value. - */ - public OffsetDateTime logEndTime() { - return this.logEndTime; - } - - /** - * Get the timeCollected property: Duration of logs collected. - * - * @return the timeCollected value. - */ - public OffsetDateTime timeCollected() { - return this.timeCollected; - } - - /** - * Get the logSize property: Size of the logs collected. - * - * @return the logSize value. - */ - public Long logSize() { - return this.logSize; - } - - /** - * Get the logCollectionStatus property: LogCollection status. - * - * @return the logCollectionStatus value. - */ - public LogCollectionStatus logCollectionStatus() { - return this.logCollectionStatus; - } - - /** - * Get the logCollectionJobType property: LogCollection job type. - * - * @return the logCollectionJobType value. - */ - public LogCollectionJobType logCollectionJobType() { - return this.logCollectionJobType; - } - - /** - * Get the correlationId property: CorrelationId of the log collection. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Get the endTimeCollected property: End Time of the logs when it was collected. - * - * @return the endTimeCollected value. - */ - public OffsetDateTime endTimeCollected() { - return this.endTimeCollected; - } - - /** - * Get the logCollectionError property: Log Collection Error details of the cluster. - * - * @return the logCollectionError value. - */ - public LogCollectionError logCollectionError() { - return this.logCollectionError; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logCollectionError() != null) { - logCollectionError().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogCollectionSession from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogCollectionSession if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the LogCollectionSession. - */ - public static LogCollectionSession fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogCollectionSession deserializedLogCollectionSession = new LogCollectionSession(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("logStartTime".equals(fieldName)) { - deserializedLogCollectionSession.logStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("logEndTime".equals(fieldName)) { - deserializedLogCollectionSession.logEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("timeCollected".equals(fieldName)) { - deserializedLogCollectionSession.timeCollected = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("logSize".equals(fieldName)) { - deserializedLogCollectionSession.logSize = reader.getNullable(JsonReader::getLong); - } else if ("logCollectionStatus".equals(fieldName)) { - deserializedLogCollectionSession.logCollectionStatus - = LogCollectionStatus.fromString(reader.getString()); - } else if ("logCollectionJobType".equals(fieldName)) { - deserializedLogCollectionSession.logCollectionJobType - = LogCollectionJobType.fromString(reader.getString()); - } else if ("correlationId".equals(fieldName)) { - deserializedLogCollectionSession.correlationId = reader.getString(); - } else if ("endTimeCollected".equals(fieldName)) { - deserializedLogCollectionSession.endTimeCollected = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("logCollectionError".equals(fieldName)) { - deserializedLogCollectionSession.logCollectionError = LogCollectionError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLogCollectionSession; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionStatus.java deleted file mode 100644 index 3a2704e2866b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogCollectionStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * LogCollection status. - */ -public final class LogCollectionStatus extends ExpandableStringEnum { - /** - * Static value None for LogCollectionStatus. - */ - public static final LogCollectionStatus NONE = fromString("None"); - - /** - * Static value InProgress for LogCollectionStatus. - */ - public static final LogCollectionStatus IN_PROGRESS = fromString("InProgress"); - - /** - * Static value Failed for LogCollectionStatus. - */ - public static final LogCollectionStatus FAILED = fromString("Failed"); - - /** - * Static value Succeeded for LogCollectionStatus. - */ - public static final LogCollectionStatus SUCCEEDED = fromString("Succeeded"); - - /** - * Creates a new instance of LogCollectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public LogCollectionStatus() { - } - - /** - * Creates or finds a LogCollectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding LogCollectionStatus. - */ - public static LogCollectionStatus fromString(String name) { - return fromString(name, LogCollectionStatus.class); - } - - /** - * Gets known LogCollectionStatus values. - * - * @return known LogCollectionStatus values. - */ - public static Collection values() { - return values(LogCollectionStatus.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkPropertiesDhcpOptions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkPropertiesDhcpOptions.java new file mode 100644 index 000000000000..a89be0ed0218 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkPropertiesDhcpOptions.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in the logical network. Standard DHCP option + * for a subnet overrides logical network DHCP options. + */ +@Fluent +public final class LogicalNetworkPropertiesDhcpOptions + implements JsonSerializable { + /* + * The list of DNS servers IP addresses. + */ + private List dnsServers; + + /** + * Creates an instance of LogicalNetworkPropertiesDhcpOptions class. + */ + public LogicalNetworkPropertiesDhcpOptions() { + } + + /** + * 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 LogicalNetworkPropertiesDhcpOptions object itself. + */ + public LogicalNetworkPropertiesDhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworkPropertiesDhcpOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworkPropertiesDhcpOptions if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworkPropertiesDhcpOptions. + */ + public static LogicalNetworkPropertiesDhcpOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworkPropertiesDhcpOptions deserializedLogicalNetworkPropertiesDhcpOptions + = new LogicalNetworkPropertiesDhcpOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedLogicalNetworkPropertiesDhcpOptions.dnsServers = dnsServers; + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworkPropertiesDhcpOptions; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatus.java new file mode 100644 index 000000000000..ecfd9ccbabd5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatus.java @@ -0,0 +1,153 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of logical networks. + */ +@Fluent +public final class LogicalNetworkStatus implements JsonSerializable { + /* + * LogicalNetwork provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The provisioningStatus property. + */ + private LogicalNetworkStatusProvisioningStatus provisioningStatus; + + /** + * Creates an instance of LogicalNetworkStatus class. + */ + public LogicalNetworkStatus() { + } + + /** + * Get the errorCode property: LogicalNetwork provisioning error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: LogicalNetwork provisioning error code. + * + * @param errorCode the errorCode value to set. + * @return the LogicalNetworkStatus object itself. + */ + public LogicalNetworkStatus 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 LogicalNetworkStatus object itself. + */ + public LogicalNetworkStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the provisioningStatus property: The provisioningStatus property. + * + * @return the provisioningStatus value. + */ + public LogicalNetworkStatusProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The provisioningStatus property. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the LogicalNetworkStatus object itself. + */ + public LogicalNetworkStatus withProvisioningStatus(LogicalNetworkStatusProvisioningStatus 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworkStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworkStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworkStatus. + */ + public static LogicalNetworkStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworkStatus deserializedLogicalNetworkStatus = new LogicalNetworkStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedLogicalNetworkStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedLogicalNetworkStatus.errorMessage = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedLogicalNetworkStatus.provisioningStatus + = LogicalNetworkStatusProvisioningStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworkStatus; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatusProvisioningStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatusProvisioningStatus.java new file mode 100644 index 000000000000..f521fa30f219 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworkStatusProvisioningStatus.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LogicalNetworkStatusProvisioningStatus model. + */ +@Fluent +public final class LogicalNetworkStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the logical network + */ + private String operationId; + + /* + * The status of the operation performed on the logical network [Succeeded, Failed, InProgress] + */ + private Status status; + + /** + * Creates an instance of LogicalNetworkStatusProvisioningStatus class. + */ + public LogicalNetworkStatusProvisioningStatus() { + } + + /** + * Get the operationId property: The ID of the operation performed on the logical network. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The ID of the operation performed on the logical network. + * + * @param operationId the operationId value to set. + * @return the LogicalNetworkStatusProvisioningStatus object itself. + */ + public LogicalNetworkStatusProvisioningStatus withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the status property: The status of the operation performed on the logical 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 logical network [Succeeded, Failed, + * InProgress]. + * + * @param status the status value to set. + * @return the LogicalNetworkStatusProvisioningStatus object itself. + */ + public LogicalNetworkStatusProvisioningStatus withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworkStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworkStatusProvisioningStatus if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworkStatusProvisioningStatus. + */ + public static LogicalNetworkStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworkStatusProvisioningStatus deserializedLogicalNetworkStatusProvisioningStatus + = new LogicalNetworkStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedLogicalNetworkStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedLogicalNetworkStatusProvisioningStatus.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworkStatusProvisioningStatus; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworks.java new file mode 100644 index 000000000000..773d035379bf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworks.java @@ -0,0 +1,332 @@ +// Copyright (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.LogicalNetworksInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of LogicalNetworks. + */ +public interface LogicalNetworks { + /** + * 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 + * logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + * + * @return the dhcpOptions value. + */ + LogicalNetworkPropertiesDhcpOptions dhcpOptions(); + + /** + * Gets the subnets property: Subnet - list of subnets under the logical network. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the provisioningState property: Provisioning state of the logical 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 logical networks. + * + * @return the status value. + */ + LogicalNetworkStatus 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.LogicalNetworksInner object. + * + * @return the inner object. + */ + LogicalNetworksInner innerModel(); + + /** + * The entirety of the LogicalNetworks definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LogicalNetworks definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogicalNetworks definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LogicalNetworks 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 LogicalNetworks 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 LogicalNetworks 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.WithSubnets, DefinitionStages.WithVmSwitchName { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogicalNetworks create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogicalNetworks create(Context context); + } + + /** + * The stage of the LogicalNetworks 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 LogicalNetworks 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 LogicalNetworks definition allowing to specify dhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies the dhcpOptions property: DhcpOptions contains an array of DNS servers available to VMs + * deployed in the logical network. Standard DHCP option for a subnet overrides logical network DHCP + * options.. + * + * @param dhcpOptions DhcpOptions contains an array of DNS servers available to VMs deployed in the logical + * network. Standard DHCP option for a subnet overrides logical network DHCP options. + * @return the next definition stage. + */ + WithCreate withDhcpOptions(LogicalNetworkPropertiesDhcpOptions dhcpOptions); + } + + /** + * The stage of the LogicalNetworks definition allowing to specify subnets. + */ + interface WithSubnets { + /** + * Specifies the subnets property: Subnet - list of subnets under the logical network. + * + * @param subnets Subnet - list of subnets under the logical network. + * @return the next definition stage. + */ + WithCreate withSubnets(List subnets); + } + + /** + * The stage of the LogicalNetworks 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 LogicalNetworks resource. + * + * @return the stage of resource update. + */ + LogicalNetworks.Update update(); + + /** + * The template for LogicalNetworks update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogicalNetworks apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogicalNetworks apply(Context context); + } + + /** + * The LogicalNetworks update stages. + */ + interface UpdateStages { + /** + * The stage of the LogicalNetworks 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. + */ + LogicalNetworks refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogicalNetworks refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksListResult.java new file mode 100644 index 000000000000..abbc5ea78d88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksListResult.java @@ -0,0 +1,128 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.LogicalNetworksInner; +import java.io.IOException; +import java.util.List; + +/** + * The LogicalNetworksListResult model. + */ +@Fluent +public final class LogicalNetworksListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of LogicalNetworksListResult class. + */ + public LogicalNetworksListResult() { + } + + /** + * 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 LogicalNetworksListResult object itself. + */ + public LogicalNetworksListResult 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 LogicalNetworksListResult object itself. + */ + public LogicalNetworksListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworksListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworksListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworksListResult. + */ + public static LogicalNetworksListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworksListResult deserializedLogicalNetworksListResult = new LogicalNetworksListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LogicalNetworksInner.fromJson(reader1)); + deserializedLogicalNetworksListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogicalNetworksListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworksListResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksOperations.java new file mode 100644 index 000000000000..b68adcd17ec3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksOperations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogicalNetworksOperations. + */ +public interface LogicalNetworksOperations { + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String logicalNetworkName, + Context context); + + /** + * The getByResourceGroup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logical network resource definition. + */ + LogicalNetworks getByResourceGroup(String resourceGroupName, String logicalNetworkName); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName); + + /** + * The operation to delete a logical network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param logicalNetworkName Name of the logical 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 logicalNetworkName, Context context); + + /** + * Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 logical networks in the specified resource group. Use the nextLink property in the response to + * get the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 logical networks in the specified subscription. Use the nextLink property in the response to get + * the next page of logical 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 logical network resource definition along with {@link Response}. + */ + LogicalNetworks 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 logical network resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a logical 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 logical 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 LogicalNetworks resource. + * + * @param name resource name. + * @return the first stage of the new LogicalNetworks definition. + */ + LogicalNetworks.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksUpdateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksUpdateRequest.java new file mode 100644 index 000000000000..15e140cdaf0a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/LogicalNetworksUpdateRequest.java @@ -0,0 +1,95 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The logical network resource patch definition. + */ +@Fluent +public final class LogicalNetworksUpdateRequest implements JsonSerializable { + /* + * Resource tags + */ + private Map tags; + + /** + * Creates an instance of LogicalNetworksUpdateRequest class. + */ + public LogicalNetworksUpdateRequest() { + } + + /** + * 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 LogicalNetworksUpdateRequest object itself. + */ + public LogicalNetworksUpdateRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicalNetworksUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicalNetworksUpdateRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogicalNetworksUpdateRequest. + */ + public static LogicalNetworksUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicalNetworksUpdateRequest deserializedLogicalNetworksUpdateRequest = new LogicalNetworksUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogicalNetworksUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogicalNetworksUpdateRequest; + }); + } +} 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 000000000000..52107a26e9ec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatus.java @@ -0,0 +1,217 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of marketplace gallery images. + */ +@Fluent +public final class MarketplaceGalleryImageStatus implements JsonSerializable { + /* + * MarketplaceGalleryImage provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The provisioningStatus property. + */ + private MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus; + + /* + * The download status of the gallery image + */ + private MarketplaceGalleryImageStatusDownloadStatus downloadStatus; + + /* + * The progress of the operation in percentage + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + jsonWriter.writeJsonField("downloadStatus", this.downloadStatus); + jsonWriter.writeNumberField("progressPercentage", this.progressPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImageStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImageStatus if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImageStatus. + */ + public static MarketplaceGalleryImageStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImageStatus deserializedMarketplaceGalleryImageStatus + = new MarketplaceGalleryImageStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatus.errorMessage = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatus.provisioningStatus + = MarketplaceGalleryImageStatusProvisioningStatus.fromJson(reader); + } else if ("downloadStatus".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatus.downloadStatus + = MarketplaceGalleryImageStatusDownloadStatus.fromJson(reader); + } else if ("progressPercentage".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatus.progressPercentage + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImageStatus; + }); + } +} 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 000000000000..9e8584b2fa84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusDownloadStatus.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The download status of the gallery image. + */ +@Fluent +public final class MarketplaceGalleryImageStatusDownloadStatus + implements JsonSerializable { + /* + * The downloaded sized of the image in MB + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("downloadSizeInMB", this.downloadSizeInMB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImageStatusDownloadStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImageStatusDownloadStatus if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImageStatusDownloadStatus. + */ + public static MarketplaceGalleryImageStatusDownloadStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImageStatusDownloadStatus deserializedMarketplaceGalleryImageStatusDownloadStatus + = new MarketplaceGalleryImageStatusDownloadStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("downloadSizeInMB".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatusDownloadStatus.downloadSizeInMB + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImageStatusDownloadStatus; + }); + } +} 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 000000000000..389380121647 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImageStatusProvisioningStatus.java @@ -0,0 +1,126 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MarketplaceGalleryImageStatusProvisioningStatus model. + */ +@Fluent +public final class MarketplaceGalleryImageStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the gallery image + */ + private String operationId; + + /* + * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImageStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImageStatusProvisioningStatus if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImageStatusProvisioningStatus. + */ + public static MarketplaceGalleryImageStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImageStatusProvisioningStatus deserializedMarketplaceGalleryImageStatusProvisioningStatus + = new MarketplaceGalleryImageStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedMarketplaceGalleryImageStatusProvisioningStatus.status + = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImageStatusProvisioningStatus; + }); + } +} 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 000000000000..c1f672be6b07 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImages.java @@ -0,0 +1,395 @@ +// Copyright (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 000000000000..d6e171908462 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesListResult.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; +import java.io.IOException; +import java.util.List; + +/** + * The MarketplaceGalleryImagesListResult model. + */ +@Fluent +public final class MarketplaceGalleryImagesListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImagesListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImagesListResult. + */ + public static MarketplaceGalleryImagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImagesListResult deserializedMarketplaceGalleryImagesListResult + = new MarketplaceGalleryImagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MarketplaceGalleryImagesInner.fromJson(reader1)); + deserializedMarketplaceGalleryImagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMarketplaceGalleryImagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImagesListResult; + }); + } +} 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 000000000000..37c6a22dcee7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesOperations.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.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 000000000000..f12db90c1eb0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/MarketplaceGalleryImagesUpdateRequest.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The marketplace gallery image resource patch definition. + */ +@Fluent +public final class MarketplaceGalleryImagesUpdateRequest + implements JsonSerializable { + /* + * Resource tags + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceGalleryImagesUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceGalleryImagesUpdateRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceGalleryImagesUpdateRequest. + */ + public static MarketplaceGalleryImagesUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceGalleryImagesUpdateRequest deserializedMarketplaceGalleryImagesUpdateRequest + = new MarketplaceGalleryImagesUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMarketplaceGalleryImagesUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceGalleryImagesUpdateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkController.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkController.java deleted file mode 100644 index 689cd7bf757f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkController.java +++ /dev/null @@ -1,152 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * network controller config for SDN Integration to deploy AzureStackHCI Cluster. - */ -@Fluent -public final class NetworkController implements JsonSerializable { - /* - * macAddressPoolStart of network controller used for SDN Integration. - */ - private String macAddressPoolStart; - - /* - * macAddressPoolStop of network controller used for SDN Integration. - */ - private String macAddressPoolStop; - - /* - * NetworkVirtualizationEnabled of network controller used for SDN Integration. - */ - private Boolean networkVirtualizationEnabled; - - /** - * Creates an instance of NetworkController class. - */ - public NetworkController() { - } - - /** - * Get the macAddressPoolStart property: macAddressPoolStart of network controller used for SDN Integration. - * - * @return the macAddressPoolStart value. - */ - public String macAddressPoolStart() { - return this.macAddressPoolStart; - } - - /** - * Set the macAddressPoolStart property: macAddressPoolStart of network controller used for SDN Integration. - * - * @param macAddressPoolStart the macAddressPoolStart value to set. - * @return the NetworkController object itself. - */ - public NetworkController withMacAddressPoolStart(String macAddressPoolStart) { - this.macAddressPoolStart = macAddressPoolStart; - return this; - } - - /** - * Get the macAddressPoolStop property: macAddressPoolStop of network controller used for SDN Integration. - * - * @return the macAddressPoolStop value. - */ - public String macAddressPoolStop() { - return this.macAddressPoolStop; - } - - /** - * Set the macAddressPoolStop property: macAddressPoolStop of network controller used for SDN Integration. - * - * @param macAddressPoolStop the macAddressPoolStop value to set. - * @return the NetworkController object itself. - */ - public NetworkController withMacAddressPoolStop(String macAddressPoolStop) { - this.macAddressPoolStop = macAddressPoolStop; - return this; - } - - /** - * Get the networkVirtualizationEnabled property: NetworkVirtualizationEnabled of network controller used for SDN - * Integration. - * - * @return the networkVirtualizationEnabled value. - */ - public Boolean networkVirtualizationEnabled() { - return this.networkVirtualizationEnabled; - } - - /** - * Set the networkVirtualizationEnabled property: NetworkVirtualizationEnabled of network controller used for SDN - * Integration. - * - * @param networkVirtualizationEnabled the networkVirtualizationEnabled value to set. - * @return the NetworkController object itself. - */ - public NetworkController withNetworkVirtualizationEnabled(Boolean networkVirtualizationEnabled) { - this.networkVirtualizationEnabled = networkVirtualizationEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("macAddressPoolStart", this.macAddressPoolStart); - jsonWriter.writeStringField("macAddressPoolStop", this.macAddressPoolStop); - jsonWriter.writeBooleanField("networkVirtualizationEnabled", this.networkVirtualizationEnabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkController from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkController if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the NetworkController. - */ - public static NetworkController fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkController deserializedNetworkController = new NetworkController(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("macAddressPoolStart".equals(fieldName)) { - deserializedNetworkController.macAddressPoolStart = reader.getString(); - } else if ("macAddressPoolStop".equals(fieldName)) { - deserializedNetworkController.macAddressPoolStop = reader.getString(); - } else if ("networkVirtualizationEnabled".equals(fieldName)) { - deserializedNetworkController.networkVirtualizationEnabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkController; - }); - } -} 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 000000000000..bfaba89bbdf8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatus.java @@ -0,0 +1,153 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of network interfaces. + */ +@Fluent +public final class NetworkInterfaceStatus implements JsonSerializable { + /* + * NetworkInterface provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The provisioningStatus property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceStatus. + */ + public static NetworkInterfaceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceStatus deserializedNetworkInterfaceStatus = new NetworkInterfaceStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedNetworkInterfaceStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedNetworkInterfaceStatus.errorMessage = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedNetworkInterfaceStatus.provisioningStatus + = NetworkInterfaceStatusProvisioningStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceStatus; + }); + } +} 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 000000000000..f5ec97fee6e6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatusProvisioningStatus.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NetworkInterfaceStatusProvisioningStatus model. + */ +@Fluent +public final class NetworkInterfaceStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the network interface + */ + private String operationId; + + /* + * The status of the operation performed on the network interface [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceStatusProvisioningStatus if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceStatusProvisioningStatus. + */ + public static NetworkInterfaceStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceStatusProvisioningStatus deserializedNetworkInterfaceStatusProvisioningStatus + = new NetworkInterfaceStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedNetworkInterfaceStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedNetworkInterfaceStatusProvisioningStatus.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceStatusProvisioningStatus; + }); + } +} 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 000000000000..8360ace87e84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaces.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.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 000000000000..a3e4aff3aae3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesListResult.java @@ -0,0 +1,128 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner; +import java.io.IOException; +import java.util.List; + +/** + * The NetworkInterfacesListResult model. + */ +@Fluent +public final class NetworkInterfacesListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfacesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfacesListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfacesListResult. + */ + public static NetworkInterfacesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfacesListResult deserializedNetworkInterfacesListResult = new NetworkInterfacesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkInterfacesInner.fromJson(reader1)); + deserializedNetworkInterfacesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkInterfacesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfacesListResult; + }); + } +} 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 000000000000..5212ffdb9282 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesOperations.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.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 000000000000..a33bf10a607b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfacesUpdateRequest.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The network interface resource patch definition. + */ +@Fluent +public final class NetworkInterfacesUpdateRequest implements JsonSerializable { + /* + * Resource tags + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfacesUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfacesUpdateRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfacesUpdateRequest. + */ + public static NetworkInterfacesUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfacesUpdateRequest deserializedNetworkInterfacesUpdateRequest + = new NetworkInterfacesUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkInterfacesUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfacesUpdateRequest; + }); + } +} 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 000000000000..06cbafe289c0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.java @@ -0,0 +1,103 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * NetworkProfile - describes the network update configuration the virtual machine instance. + */ +@Fluent +public final class NetworkProfileUpdate implements JsonSerializable { + /* + * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfileUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfileUpdate. + */ + public static NetworkProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfileUpdate deserializedNetworkProfileUpdate = new NetworkProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkProfileUpdateNetworkInterfacesItem.fromJson(reader1)); + deserializedNetworkProfileUpdate.networkInterfaces = networkInterfaces; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfileUpdate; + }); + } +} 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 000000000000..1c8d5b85b59d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java @@ -0,0 +1,95 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NetworkProfileUpdateNetworkInterfacesItem model. + */ +@Fluent +public final class NetworkProfileUpdateNetworkInterfacesItem + implements JsonSerializable { + /* + * ID - Resource ID of the network interface + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfileUpdateNetworkInterfacesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfileUpdateNetworkInterfacesItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfileUpdateNetworkInterfacesItem. + */ + public static NetworkProfileUpdateNetworkInterfacesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfileUpdateNetworkInterfacesItem deserializedNetworkProfileUpdateNetworkInterfacesItem + = new NetworkProfileUpdateNetworkInterfacesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkProfileUpdateNetworkInterfacesItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfileUpdateNetworkInterfacesItem; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NicDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NicDetail.java index 0b751f5819b3..13e8a6ba6095 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NicDetail.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NicDetail.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -254,8 +255,14 @@ public NicDetail withDefaultIsolationId(String defaultIsolationId) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (adapterName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property adapterName in model NicDetail")); + } } + private static final ClientLogger LOGGER = new ClientLogger(NicDetail.class); + /** * {@inheritDoc} */ @@ -280,6 +287,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NicDetail if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NicDetail. */ public static NicDetail fromJson(JsonReader jsonReader) throws IOException { 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 000000000000..df7868d01653 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java @@ -0,0 +1,56 @@ +// Copyright (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; + +/** + * 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. + */ + 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} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationType.java deleted file mode 100644 index d33ea74ac5e0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationType.java +++ /dev/null @@ -1,51 +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 java.util.Collection; - -/** - * The intended operation for a cluster. - */ -public final class OperationType extends ExpandableStringEnum { - /** - * Static value ClusterProvisioning for OperationType. - */ - public static final OperationType CLUSTER_PROVISIONING = fromString("ClusterProvisioning"); - - /** - * Static value ClusterUpgrade for OperationType. - */ - public static final OperationType CLUSTER_UPGRADE = fromString("ClusterUpgrade"); - - /** - * Creates a new instance of OperationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OperationType() { - } - - /** - * Creates or finds a OperationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationType. - */ - public static OperationType fromString(String name) { - return fromString(name, OperationType.class); - } - - /** - * Gets known OperationType values. - * - * @return known OperationType values. - */ - public static Collection values() { - return values(OperationType.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 000000000000..3e4e83a23121 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdate.java @@ -0,0 +1,156 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OsProfile - describes the update configuration of the operating system. + */ +@Fluent +public final class OsProfileUpdate implements JsonSerializable { + /* + * ComputerName - name of the computer + */ + private String computerName; + + /* + * The linuxConfiguration property. + */ + private OsProfileUpdateLinuxConfiguration linuxConfiguration; + + /* + * The windowsConfiguration property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computerName", this.computerName); + jsonWriter.writeJsonField("linuxConfiguration", this.linuxConfiguration); + jsonWriter.writeJsonField("windowsConfiguration", this.windowsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OsProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OsProfileUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OsProfileUpdate. + */ + public static OsProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OsProfileUpdate deserializedOsProfileUpdate = new OsProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computerName".equals(fieldName)) { + deserializedOsProfileUpdate.computerName = reader.getString(); + } else if ("linuxConfiguration".equals(fieldName)) { + deserializedOsProfileUpdate.linuxConfiguration = OsProfileUpdateLinuxConfiguration.fromJson(reader); + } else if ("windowsConfiguration".equals(fieldName)) { + deserializedOsProfileUpdate.windowsConfiguration + = OsProfileUpdateWindowsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOsProfileUpdate; + }); + } +} 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 000000000000..3cb431e67d3b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateLinuxConfiguration.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The OsProfileUpdateLinuxConfiguration model. + */ +@Fluent +public final class OsProfileUpdateLinuxConfiguration implements JsonSerializable { + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. + */ + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeBooleanField("provisionVMConfigAgent", this.provisionVMConfigAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OsProfileUpdateLinuxConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OsProfileUpdateLinuxConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OsProfileUpdateLinuxConfiguration. + */ + public static OsProfileUpdateLinuxConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OsProfileUpdateLinuxConfiguration deserializedOsProfileUpdateLinuxConfiguration + = new OsProfileUpdateLinuxConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionVMAgent".equals(fieldName)) { + deserializedOsProfileUpdateLinuxConfiguration.provisionVMAgent + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisionVMConfigAgent".equals(fieldName)) { + deserializedOsProfileUpdateLinuxConfiguration.provisionVMConfigAgent + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOsProfileUpdateLinuxConfiguration; + }); + } +} 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 000000000000..73bd842e10d0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OsProfileUpdateWindowsConfiguration.java @@ -0,0 +1,130 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The OsProfileUpdateWindowsConfiguration model. + */ +@Fluent +public final class OsProfileUpdateWindowsConfiguration + implements JsonSerializable { + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. + */ + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeBooleanField("provisionVMConfigAgent", this.provisionVMConfigAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OsProfileUpdateWindowsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OsProfileUpdateWindowsConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OsProfileUpdateWindowsConfiguration. + */ + public static OsProfileUpdateWindowsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OsProfileUpdateWindowsConfiguration deserializedOsProfileUpdateWindowsConfiguration + = new OsProfileUpdateWindowsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionVMAgent".equals(fieldName)) { + deserializedOsProfileUpdateWindowsConfiguration.provisionVMAgent + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisionVMConfigAgent".equals(fieldName)) { + deserializedOsProfileUpdateWindowsConfiguration.provisionVMConfigAgent + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOsProfileUpdateWindowsConfiguration; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeRemoteSupportSession.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeRemoteSupportSession.java deleted file mode 100644 index 7f5ed4926404..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeRemoteSupportSession.java +++ /dev/null @@ -1,149 +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.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Remote Support Node Session Details on the Node. - */ -@Immutable -public final class PerNodeRemoteSupportSession implements JsonSerializable { - /* - * Remote Support Session StartTime on the Node - */ - private OffsetDateTime sessionStartTime; - - /* - * Remote Support Session EndTime on the Node - */ - private OffsetDateTime sessionEndTime; - - /* - * Name of the node - */ - private String nodeName; - - /* - * Duration of Remote Support Enablement - */ - private Long duration; - - /* - * Remote Support Access Level - */ - private AccessLevel accessLevel; - - /** - * Creates an instance of PerNodeRemoteSupportSession class. - */ - public PerNodeRemoteSupportSession() { - } - - /** - * Get the sessionStartTime property: Remote Support Session StartTime on the Node. - * - * @return the sessionStartTime value. - */ - public OffsetDateTime sessionStartTime() { - return this.sessionStartTime; - } - - /** - * Get the sessionEndTime property: Remote Support Session EndTime on the Node. - * - * @return the sessionEndTime value. - */ - public OffsetDateTime sessionEndTime() { - return this.sessionEndTime; - } - - /** - * Get the nodeName property: Name of the node. - * - * @return the nodeName value. - */ - public String nodeName() { - return this.nodeName; - } - - /** - * Get the duration property: Duration of Remote Support Enablement. - * - * @return the duration value. - */ - public Long duration() { - return this.duration; - } - - /** - * Get the accessLevel property: Remote Support Access Level. - * - * @return the accessLevel value. - */ - public AccessLevel accessLevel() { - return this.accessLevel; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PerNodeRemoteSupportSession from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PerNodeRemoteSupportSession if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PerNodeRemoteSupportSession. - */ - public static PerNodeRemoteSupportSession fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PerNodeRemoteSupportSession deserializedPerNodeRemoteSupportSession = new PerNodeRemoteSupportSession(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sessionStartTime".equals(fieldName)) { - deserializedPerNodeRemoteSupportSession.sessionStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("sessionEndTime".equals(fieldName)) { - deserializedPerNodeRemoteSupportSession.sessionEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("nodeName".equals(fieldName)) { - deserializedPerNodeRemoteSupportSession.nodeName = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedPerNodeRemoteSupportSession.duration = reader.getNullable(JsonReader::getLong); - } else if ("accessLevel".equals(fieldName)) { - deserializedPerNodeRemoteSupportSession.accessLevel = AccessLevel.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedPerNodeRemoteSupportSession; - }); - } -} 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 000000000000..e340e62d7844 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PowerStateEnum.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.util.ExpandableStringEnum; +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. + */ + 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/PrecheckResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java index 307594b43fad..3a0cae43cca6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java @@ -34,11 +34,6 @@ public final class PrecheckResult implements JsonSerializable { */ private PrecheckResultTags tags; - /* - * Key-value pairs that allow grouping/filtering individual tests. - */ - private Object healthCheckTags; - /* * User-facing name; one or more sentences indicating the direct issue. */ @@ -77,12 +72,7 @@ public final class PrecheckResult implements JsonSerializable { private String targetResourceName; /* - * The type of resource being referred to (well-known set of nouns in infrastructure, aligning with Monitoring). - */ - private String targetResourceType; - - /* - * The time in which the HealthCheck was called. + * The Time in which the HealthCheck was called. */ private OffsetDateTime timestamp; @@ -164,26 +154,6 @@ public PrecheckResult withTags(PrecheckResultTags tags) { return this; } - /** - * Get the healthCheckTags property: Key-value pairs that allow grouping/filtering individual tests. - * - * @return the healthCheckTags value. - */ - public Object healthCheckTags() { - return this.healthCheckTags; - } - - /** - * Set the healthCheckTags property: Key-value pairs that allow grouping/filtering individual tests. - * - * @param healthCheckTags the healthCheckTags value to set. - * @return the PrecheckResult object itself. - */ - public PrecheckResult withHealthCheckTags(Object healthCheckTags) { - this.healthCheckTags = healthCheckTags; - return this; - } - /** * Get the title property: User-facing name; one or more sentences indicating the direct issue. * @@ -329,29 +299,7 @@ public PrecheckResult withTargetResourceName(String targetResourceName) { } /** - * Get the targetResourceType property: The type of resource being referred to (well-known set of nouns in - * infrastructure, aligning with Monitoring). - * - * @return the targetResourceType value. - */ - public String targetResourceType() { - return this.targetResourceType; - } - - /** - * Set the targetResourceType property: The type of resource being referred to (well-known set of nouns in - * infrastructure, aligning with Monitoring). - * - * @param targetResourceType the targetResourceType value to set. - * @return the PrecheckResult object itself. - */ - public PrecheckResult withTargetResourceType(String targetResourceType) { - this.targetResourceType = targetResourceType; - return this; - } - - /** - * Get the timestamp property: The time in which the HealthCheck was called. + * Get the timestamp property: The Time in which the HealthCheck was called. * * @return the timestamp value. */ @@ -360,7 +308,7 @@ public OffsetDateTime timestamp() { } /** - * Set the timestamp property: The time in which the HealthCheck was called. + * Set the timestamp property: The Time in which the HealthCheck was called. * * @param timestamp the timestamp value to set. * @return the PrecheckResult object itself. @@ -432,7 +380,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("displayName", this.displayName); jsonWriter.writeJsonField("tags", this.tags); - jsonWriter.writeUntypedField("healthCheckTags", this.healthCheckTags); jsonWriter.writeStringField("title", this.title); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); @@ -440,7 +387,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("remediation", this.remediation); jsonWriter.writeStringField("targetResourceID", this.targetResourceId); jsonWriter.writeStringField("targetResourceName", this.targetResourceName); - jsonWriter.writeStringField("targetResourceType", this.targetResourceType); jsonWriter.writeStringField("timestamp", this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); jsonWriter.writeStringField("additionalData", this.additionalData); @@ -469,8 +415,6 @@ public static PrecheckResult fromJson(JsonReader jsonReader) throws IOException deserializedPrecheckResult.displayName = reader.getString(); } else if ("tags".equals(fieldName)) { deserializedPrecheckResult.tags = PrecheckResultTags.fromJson(reader); - } else if ("healthCheckTags".equals(fieldName)) { - deserializedPrecheckResult.healthCheckTags = reader.readUntyped(); } else if ("title".equals(fieldName)) { deserializedPrecheckResult.title = reader.getString(); } else if ("status".equals(fieldName)) { @@ -485,8 +429,6 @@ public static PrecheckResult fromJson(JsonReader jsonReader) throws IOException deserializedPrecheckResult.targetResourceId = reader.getString(); } else if ("targetResourceName".equals(fieldName)) { deserializedPrecheckResult.targetResourceName = reader.getString(); - } else if ("targetResourceType".equals(fieldName)) { - deserializedPrecheckResult.targetResourceType = reader.getString(); } else if ("timestamp".equals(fieldName)) { deserializedPrecheckResult.timestamp = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); 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 000000000000..9e2f67139289 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningAction.java @@ -0,0 +1,56 @@ +// Copyright (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 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. + */ + 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/ProvisioningStateEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java new file mode 100644 index 000000000000..60fe4de7b541 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java @@ -0,0 +1,71 @@ +// Copyright (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 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. + */ + 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/RemoteSupportNodeSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportNodeSettings.java deleted file mode 100644 index 9dc320e13015..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportNodeSettings.java +++ /dev/null @@ -1,181 +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.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Remote Support Node Settings of the cluster. - */ -@Immutable -public final class RemoteSupportNodeSettings implements JsonSerializable { - /* - * Arc ResourceId of the Node - */ - private String arcResourceId; - - /* - * Remote Support Access Connection State on the Node - */ - private String state; - - /* - * Remote Support Enablement Request Created TimeStamp on the Node - */ - private OffsetDateTime createdAt; - - /* - * Remote Support Enablement Request Updated TimeStamp on the Node - */ - private OffsetDateTime updatedAt; - - /* - * Remote Support Access Connection Status on the Node - */ - private String connectionStatus; - - /* - * Remote Support Access Connection Error Message on the Node - */ - private String connectionErrorMessage; - - /* - * Remote Support Transcript location on the node - */ - private String transcriptLocation; - - /** - * Creates an instance of RemoteSupportNodeSettings class. - */ - public RemoteSupportNodeSettings() { - } - - /** - * Get the arcResourceId property: Arc ResourceId of the Node. - * - * @return the arcResourceId value. - */ - public String arcResourceId() { - return this.arcResourceId; - } - - /** - * Get the state property: Remote Support Access Connection State on the Node. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the createdAt property: Remote Support Enablement Request Created TimeStamp on the Node. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: Remote Support Enablement Request Updated TimeStamp on the Node. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.updatedAt; - } - - /** - * Get the connectionStatus property: Remote Support Access Connection Status on the Node. - * - * @return the connectionStatus value. - */ - public String connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the connectionErrorMessage property: Remote Support Access Connection Error Message on the Node. - * - * @return the connectionErrorMessage value. - */ - public String connectionErrorMessage() { - return this.connectionErrorMessage; - } - - /** - * Get the transcriptLocation property: Remote Support Transcript location on the node. - * - * @return the transcriptLocation value. - */ - public String transcriptLocation() { - return this.transcriptLocation; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteSupportNodeSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteSupportNodeSettings if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RemoteSupportNodeSettings. - */ - public static RemoteSupportNodeSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteSupportNodeSettings deserializedRemoteSupportNodeSettings = new RemoteSupportNodeSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("arcResourceId".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.arcResourceId = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.state = reader.getString(); - } else if ("createdAt".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedAt".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.updatedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("connectionStatus".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.connectionStatus = reader.getString(); - } else if ("connectionErrorMessage".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.connectionErrorMessage = reader.getString(); - } else if ("transcriptLocation".equals(fieldName)) { - deserializedRemoteSupportNodeSettings.transcriptLocation = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteSupportNodeSettings; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportProperties.java deleted file mode 100644 index bc10b59400fb..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportProperties.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.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Remote Support properties of the cluster. - */ -@Immutable -public final class RemoteSupportProperties implements JsonSerializable { - /* - * Remote Support Access Level - */ - private AccessLevel accessLevel; - - /* - * Expiration DateTimeStamp when Remote Support Access will be expired - */ - private OffsetDateTime expirationTimestamp; - - /* - * Remote Support Type for cluster - */ - private RemoteSupportType remoteSupportType; - - /* - * The remoteSupportNodeSettings property. - */ - private List remoteSupportNodeSettings; - - /* - * The remoteSupportSessionDetails property. - */ - private List remoteSupportSessionDetails; - - /** - * Creates an instance of RemoteSupportProperties class. - */ - public RemoteSupportProperties() { - } - - /** - * Get the accessLevel property: Remote Support Access Level. - * - * @return the accessLevel value. - */ - public AccessLevel accessLevel() { - return this.accessLevel; - } - - /** - * Get the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired. - * - * @return the expirationTimestamp value. - */ - public OffsetDateTime expirationTimestamp() { - return this.expirationTimestamp; - } - - /** - * Get the remoteSupportType property: Remote Support Type for cluster. - * - * @return the remoteSupportType value. - */ - public RemoteSupportType remoteSupportType() { - return this.remoteSupportType; - } - - /** - * Get the remoteSupportNodeSettings property: The remoteSupportNodeSettings property. - * - * @return the remoteSupportNodeSettings value. - */ - public List remoteSupportNodeSettings() { - return this.remoteSupportNodeSettings; - } - - /** - * Get the remoteSupportSessionDetails property: The remoteSupportSessionDetails property. - * - * @return the remoteSupportSessionDetails value. - */ - public List remoteSupportSessionDetails() { - return this.remoteSupportSessionDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remoteSupportNodeSettings() != null) { - remoteSupportNodeSettings().forEach(e -> e.validate()); - } - if (remoteSupportSessionDetails() != null) { - remoteSupportSessionDetails().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteSupportProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteSupportProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the RemoteSupportProperties. - */ - public static RemoteSupportProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteSupportProperties deserializedRemoteSupportProperties = new RemoteSupportProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("accessLevel".equals(fieldName)) { - deserializedRemoteSupportProperties.accessLevel = AccessLevel.fromString(reader.getString()); - } else if ("expirationTimeStamp".equals(fieldName)) { - deserializedRemoteSupportProperties.expirationTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("remoteSupportType".equals(fieldName)) { - deserializedRemoteSupportProperties.remoteSupportType - = RemoteSupportType.fromString(reader.getString()); - } else if ("remoteSupportNodeSettings".equals(fieldName)) { - List remoteSupportNodeSettings - = reader.readArray(reader1 -> RemoteSupportNodeSettings.fromJson(reader1)); - deserializedRemoteSupportProperties.remoteSupportNodeSettings = remoteSupportNodeSettings; - } else if ("remoteSupportSessionDetails".equals(fieldName)) { - List remoteSupportSessionDetails - = reader.readArray(reader1 -> PerNodeRemoteSupportSession.fromJson(reader1)); - deserializedRemoteSupportProperties.remoteSupportSessionDetails = remoteSupportSessionDetails; - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteSupportProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequest.java deleted file mode 100644 index 42a6f7a4afc5..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequest.java +++ /dev/null @@ -1,96 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Remote Support Request. - */ -@Fluent -public final class RemoteSupportRequest implements JsonSerializable { - /* - * Properties for Remote Support Request - */ - private RemoteSupportRequestProperties properties; - - /** - * Creates an instance of RemoteSupportRequest class. - */ - public RemoteSupportRequest() { - } - - /** - * Get the properties property: Properties for Remote Support Request. - * - * @return the properties value. - */ - public RemoteSupportRequestProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties for Remote Support Request. - * - * @param properties the properties value to set. - * @return the RemoteSupportRequest object itself. - */ - public RemoteSupportRequest withProperties(RemoteSupportRequestProperties 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteSupportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteSupportRequest if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the RemoteSupportRequest. - */ - public static RemoteSupportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteSupportRequest deserializedRemoteSupportRequest = new RemoteSupportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedRemoteSupportRequest.properties = RemoteSupportRequestProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteSupportRequest; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequestProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequestProperties.java deleted file mode 100644 index 164c7f699db6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportRequestProperties.java +++ /dev/null @@ -1,147 +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.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties for Remote Support Request. - */ -@Fluent -public final class RemoteSupportRequestProperties implements JsonSerializable { - /* - * Remote Support Access Level - */ - private AccessLevel accessLevel; - - /* - * Expiration DateTimeStamp when Remote Support Access will be expired - */ - private OffsetDateTime expirationTimestamp; - - /* - * Remote Support Type for cluster - */ - private RemoteSupportType remoteSupportType; - - /** - * Creates an instance of RemoteSupportRequestProperties class. - */ - public RemoteSupportRequestProperties() { - } - - /** - * Get the accessLevel property: Remote Support Access Level. - * - * @return the accessLevel value. - */ - public AccessLevel accessLevel() { - return this.accessLevel; - } - - /** - * Get the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired. - * - * @return the expirationTimestamp value. - */ - public OffsetDateTime expirationTimestamp() { - return this.expirationTimestamp; - } - - /** - * Set the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired. - * - * @param expirationTimestamp the expirationTimestamp value to set. - * @return the RemoteSupportRequestProperties object itself. - */ - public RemoteSupportRequestProperties withExpirationTimestamp(OffsetDateTime expirationTimestamp) { - this.expirationTimestamp = expirationTimestamp; - return this; - } - - /** - * Get the remoteSupportType property: Remote Support Type for cluster. - * - * @return the remoteSupportType value. - */ - public RemoteSupportType remoteSupportType() { - return this.remoteSupportType; - } - - /** - * Set the remoteSupportType property: Remote Support Type for cluster. - * - * @param remoteSupportType the remoteSupportType value to set. - * @return the RemoteSupportRequestProperties object itself. - */ - public RemoteSupportRequestProperties withRemoteSupportType(RemoteSupportType remoteSupportType) { - this.remoteSupportType = remoteSupportType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expirationTimeStamp", - this.expirationTimestamp == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTimestamp)); - jsonWriter.writeStringField("remoteSupportType", - this.remoteSupportType == null ? null : this.remoteSupportType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteSupportRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteSupportRequestProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RemoteSupportRequestProperties. - */ - public static RemoteSupportRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteSupportRequestProperties deserializedRemoteSupportRequestProperties - = new RemoteSupportRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("accessLevel".equals(fieldName)) { - deserializedRemoteSupportRequestProperties.accessLevel = AccessLevel.fromString(reader.getString()); - } else if ("expirationTimeStamp".equals(fieldName)) { - deserializedRemoteSupportRequestProperties.expirationTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("remoteSupportType".equals(fieldName)) { - deserializedRemoteSupportRequestProperties.remoteSupportType - = RemoteSupportType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteSupportRequestProperties; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportType.java deleted file mode 100644 index 01bfc68dbf65..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RemoteSupportType.java +++ /dev/null @@ -1,51 +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 java.util.Collection; - -/** - * Remote Support Type for cluster. - */ -public final class RemoteSupportType extends ExpandableStringEnum { - /** - * Static value Enable for RemoteSupportType. - */ - public static final RemoteSupportType ENABLE = fromString("Enable"); - - /** - * Static value Revoke for RemoteSupportType. - */ - public static final RemoteSupportType REVOKE = fromString("Revoke"); - - /** - * Creates a new instance of RemoteSupportType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RemoteSupportType() { - } - - /** - * Creates or finds a RemoteSupportType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RemoteSupportType. - */ - public static RemoteSupportType fromString(String name) { - return fromString(name, RemoteSupportType.class); - } - - /** - * Gets known RemoteSupportType values. - * - * @return known RemoteSupportType values. - */ - public static Collection values() { - return values(RemoteSupportType.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ReportedProperties.java index aae1bf0e90aa..db3f735fe5b8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ReportedProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ReportedProperties.java @@ -12,19 +12,19 @@ import java.io.IOException; /** - * Reported properties pushed from edge device. + * The DeploymentStatus of AzureStackHCI Cluster. */ @Immutable -public class ReportedProperties implements JsonSerializable { +public final class ReportedProperties implements JsonSerializable { /* - * edge device state. + * validation status of AzureStackHCI Cluster Deployment. */ - private DeviceState deviceState; + private ValidationStatus validationStatus; /* - * Extensions details for edge device. + * Deployment status of AzureStackHCI Cluster Deployment. */ - private ExtensionProfile extensionProfile; + private DeploymentStatus deploymentStatus; /** * Creates an instance of ReportedProperties class. @@ -33,43 +33,21 @@ public ReportedProperties() { } /** - * Get the deviceState property: edge device state. + * Get the validationStatus property: validation status of AzureStackHCI Cluster Deployment. * - * @return the deviceState value. + * @return the validationStatus value. */ - public DeviceState deviceState() { - return this.deviceState; + public ValidationStatus validationStatus() { + return this.validationStatus; } /** - * Set the deviceState property: edge device state. + * Get the deploymentStatus property: Deployment status of AzureStackHCI Cluster Deployment. * - * @param deviceState the deviceState value to set. - * @return the ReportedProperties object itself. + * @return the deploymentStatus value. */ - ReportedProperties withDeviceState(DeviceState deviceState) { - this.deviceState = deviceState; - return this; - } - - /** - * Get the extensionProfile property: Extensions details for edge device. - * - * @return the extensionProfile value. - */ - public ExtensionProfile extensionProfile() { - return this.extensionProfile; - } - - /** - * Set the extensionProfile property: Extensions details for edge device. - * - * @param extensionProfile the extensionProfile value to set. - * @return the ReportedProperties object itself. - */ - ReportedProperties withExtensionProfile(ExtensionProfile extensionProfile) { - this.extensionProfile = extensionProfile; - return this; + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; } /** @@ -78,8 +56,11 @@ ReportedProperties withExtensionProfile(ExtensionProfile extensionProfile) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (extensionProfile() != null) { - extensionProfile().validate(); + if (validationStatus() != null) { + validationStatus().validate(); + } + if (deploymentStatus() != null) { + deploymentStatus().validate(); } } @@ -107,10 +88,10 @@ public static ReportedProperties fromJson(JsonReader jsonReader) throws IOExcept String fieldName = reader.getFieldName(); reader.nextToken(); - if ("deviceState".equals(fieldName)) { - deserializedReportedProperties.deviceState = DeviceState.fromString(reader.getString()); - } else if ("extensionProfile".equals(fieldName)) { - deserializedReportedProperties.extensionProfile = ExtensionProfile.fromJson(reader); + if ("validationStatus".equals(fieldName)) { + deserializedReportedProperties.validationStatus = ValidationStatus.fromJson(reader); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedReportedProperties.deploymentStatus = DeploymentStatus.fromJson(reader); } else { reader.skipChildren(); } 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 000000000000..5c6eb4509c52 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ResourceIdentityType.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; + +/** + * 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. + */ + 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} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Route.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Route.java new file mode 100644 index 000000000000..2934d761b5b0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Route.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.RoutePropertiesFormat; +import java.io.IOException; + +/** + * Route - Route resource. + */ +@Fluent +public final class Route implements JsonSerializable { + /* + * Properties of the route. + */ + private RoutePropertiesFormat innerProperties; + + /* + * Name - name of the subnet + */ + private String name; + + /** + * Creates an instance of Route class. + */ + public Route() { + } + + /** + * Get the innerProperties property: Properties of the route. + * + * @return the innerProperties value. + */ + private RoutePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 Route object itself. + */ + public Route withName(String name) { + this.name = name; + return this; + } + + /** + * Get the addressPrefix property: 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: The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Route object itself. + */ + public Route withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the nextHopIpAddress property: 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: 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 Route object itself. + */ + public Route withNextHopIpAddress(String nextHopIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Route. + */ + public static Route fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route deserializedRoute = new Route(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRoute.innerProperties = RoutePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedRoute.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RouteTable.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RouteTable.java new file mode 100644 index 000000000000..6bd3bfc396ac --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RouteTable.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.RouteTablePropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Route table resource. + */ +@Fluent +public final class RouteTable implements JsonSerializable { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource name. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /* + * Properties of the route table. + */ + private RouteTablePropertiesFormat innerProperties; + + /** + * Creates an instance of RouteTable class. + */ + public RouteTable() { + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Properties of the route table. + * + * @return the innerProperties value. + */ + private RouteTablePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the routes property: 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: Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the RouteTable object itself. + */ + public RouteTable withRoutes(List routes) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteTablePropertiesFormat(); + } + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteTable if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RouteTable. + */ + public static RouteTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteTable deserializedRouteTable = new RouteTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("etag".equals(fieldName)) { + deserializedRouteTable.etag = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRouteTable.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteTable.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRouteTable.innerProperties = RouteTablePropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteTable; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeCredentials.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeCredentials.java deleted file mode 100644 index f59dc1414cfa..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeCredentials.java +++ /dev/null @@ -1,149 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * secrets used for solution builder extension (SBE) partner extensibility. - */ -@Fluent -public final class SbeCredentials implements JsonSerializable { - /* - * secret name stored in keyvault. - */ - private String secretName; - - /* - * secret name expected for Enterprise Cloud Engine (ECE). - */ - private String eceSecretName; - - /* - * secret URI stored in keyvault. - */ - private String secretLocation; - - /** - * Creates an instance of SbeCredentials class. - */ - public SbeCredentials() { - } - - /** - * Get the secretName property: secret name stored in keyvault. - * - * @return the secretName value. - */ - public String secretName() { - return this.secretName; - } - - /** - * Set the secretName property: secret name stored in keyvault. - * - * @param secretName the secretName value to set. - * @return the SbeCredentials object itself. - */ - public SbeCredentials withSecretName(String secretName) { - this.secretName = secretName; - return this; - } - - /** - * Get the eceSecretName property: secret name expected for Enterprise Cloud Engine (ECE). - * - * @return the eceSecretName value. - */ - public String eceSecretName() { - return this.eceSecretName; - } - - /** - * Set the eceSecretName property: secret name expected for Enterprise Cloud Engine (ECE). - * - * @param eceSecretName the eceSecretName value to set. - * @return the SbeCredentials object itself. - */ - public SbeCredentials withEceSecretName(String eceSecretName) { - this.eceSecretName = eceSecretName; - return this; - } - - /** - * Get the secretLocation property: secret URI stored in keyvault. - * - * @return the secretLocation value. - */ - public String secretLocation() { - return this.secretLocation; - } - - /** - * Set the secretLocation property: secret URI stored in keyvault. - * - * @param secretLocation the secretLocation value to set. - * @return the SbeCredentials object itself. - */ - public SbeCredentials withSecretLocation(String secretLocation) { - this.secretLocation = secretLocation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("secretName", this.secretName); - jsonWriter.writeStringField("eceSecretName", this.eceSecretName); - jsonWriter.writeStringField("secretLocation", this.secretLocation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SbeCredentials from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SbeCredentials if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SbeCredentials. - */ - public static SbeCredentials fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SbeCredentials deserializedSbeCredentials = new SbeCredentials(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretName".equals(fieldName)) { - deserializedSbeCredentials.secretName = reader.getString(); - } else if ("eceSecretName".equals(fieldName)) { - deserializedSbeCredentials.eceSecretName = reader.getString(); - } else if ("secretLocation".equals(fieldName)) { - deserializedSbeCredentials.secretLocation = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSbeCredentials; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentInfo.java deleted file mode 100644 index 5f61f8974781..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentInfo.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Solution builder extension (SBE) package and manifest information for the solution builder extension staged for - * AzureStackHCI cluster deployment. - */ -@Fluent -public final class SbeDeploymentInfo implements JsonSerializable { - /* - * SBE package version. - */ - private String version; - - /* - * SBE family name. - */ - private String family; - - /* - * SBE manifest publisher. - */ - private String publisher; - - /* - * SBE Manifest Source. - */ - private String sbeManifestSource; - - /* - * SBE Manifest Creation Date. - */ - private OffsetDateTime sbeManifestCreationDate; - - /** - * Creates an instance of SbeDeploymentInfo class. - */ - public SbeDeploymentInfo() { - } - - /** - * Get the version property: SBE package version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: SBE package version. - * - * @param version the version value to set. - * @return the SbeDeploymentInfo object itself. - */ - public SbeDeploymentInfo withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the family property: SBE family name. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: SBE family name. - * - * @param family the family value to set. - * @return the SbeDeploymentInfo object itself. - */ - public SbeDeploymentInfo withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the publisher property: SBE manifest publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: SBE manifest publisher. - * - * @param publisher the publisher value to set. - * @return the SbeDeploymentInfo object itself. - */ - public SbeDeploymentInfo withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the sbeManifestSource property: SBE Manifest Source. - * - * @return the sbeManifestSource value. - */ - public String sbeManifestSource() { - return this.sbeManifestSource; - } - - /** - * Set the sbeManifestSource property: SBE Manifest Source. - * - * @param sbeManifestSource the sbeManifestSource value to set. - * @return the SbeDeploymentInfo object itself. - */ - public SbeDeploymentInfo withSbeManifestSource(String sbeManifestSource) { - this.sbeManifestSource = sbeManifestSource; - return this; - } - - /** - * Get the sbeManifestCreationDate property: SBE Manifest Creation Date. - * - * @return the sbeManifestCreationDate value. - */ - public OffsetDateTime sbeManifestCreationDate() { - return this.sbeManifestCreationDate; - } - - /** - * Set the sbeManifestCreationDate property: SBE Manifest Creation Date. - * - * @param sbeManifestCreationDate the sbeManifestCreationDate value to set. - * @return the SbeDeploymentInfo object itself. - */ - public SbeDeploymentInfo withSbeManifestCreationDate(OffsetDateTime sbeManifestCreationDate) { - this.sbeManifestCreationDate = sbeManifestCreationDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("version", this.version); - jsonWriter.writeStringField("family", this.family); - jsonWriter.writeStringField("publisher", this.publisher); - jsonWriter.writeStringField("sbeManifestSource", this.sbeManifestSource); - jsonWriter.writeStringField("sbeManifestCreationDate", - this.sbeManifestCreationDate == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sbeManifestCreationDate)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SbeDeploymentInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SbeDeploymentInfo if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SbeDeploymentInfo. - */ - public static SbeDeploymentInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SbeDeploymentInfo deserializedSbeDeploymentInfo = new SbeDeploymentInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("version".equals(fieldName)) { - deserializedSbeDeploymentInfo.version = reader.getString(); - } else if ("family".equals(fieldName)) { - deserializedSbeDeploymentInfo.family = reader.getString(); - } else if ("publisher".equals(fieldName)) { - deserializedSbeDeploymentInfo.publisher = reader.getString(); - } else if ("sbeManifestSource".equals(fieldName)) { - deserializedSbeDeploymentInfo.sbeManifestSource = reader.getString(); - } else if ("sbeManifestCreationDate".equals(fieldName)) { - deserializedSbeDeploymentInfo.sbeManifestCreationDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedSbeDeploymentInfo; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentPackageInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentPackageInfo.java deleted file mode 100644 index 90eee34dbcad..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbeDeploymentPackageInfo.java +++ /dev/null @@ -1,114 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Solution builder extension (SBE) deployment package information. - */ -@Immutable -public final class SbeDeploymentPackageInfo implements JsonSerializable { - /* - * SBE deployment validation code. - */ - private String code; - - /* - * A detailed message that explains the SBE package validation result. - */ - private String message; - - /* - * This represents discovered update results for matching updates and store it as SBE manifest. - */ - private String sbeManifest; - - /** - * Creates an instance of SbeDeploymentPackageInfo class. - */ - public SbeDeploymentPackageInfo() { - } - - /** - * Get the code property: SBE deployment validation code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: A detailed message that explains the SBE package validation result. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the sbeManifest property: This represents discovered update results for matching updates and store it as SBE - * manifest. - * - * @return the sbeManifest value. - */ - public String sbeManifest() { - return this.sbeManifest; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SbeDeploymentPackageInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SbeDeploymentPackageInfo if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SbeDeploymentPackageInfo. - */ - public static SbeDeploymentPackageInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SbeDeploymentPackageInfo deserializedSbeDeploymentPackageInfo = new SbeDeploymentPackageInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedSbeDeploymentPackageInfo.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedSbeDeploymentPackageInfo.message = reader.getString(); - } else if ("sbeManifest".equals(fieldName)) { - deserializedSbeDeploymentPackageInfo.sbeManifest = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSbeDeploymentPackageInfo; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerInfo.java deleted file mode 100644 index 56216262ceb3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SbePartnerInfo.java +++ /dev/null @@ -1,167 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The solution builder extension (SBE) partner deployment info for cluster. - */ -@Fluent -public final class SbePartnerInfo implements JsonSerializable { - /* - * SBE package and manifest information for the solution Builder Extension staged for AzureStackHCI cluster - * deployment. - */ - private SbeDeploymentInfo sbeDeploymentInfo; - - /* - * List of SBE partner properties for AzureStackHCI cluster deployment. - */ - private List partnerProperties; - - /* - * SBE credentials list for AzureStackHCI cluster deployment. - */ - private List credentialList; - - /** - * Creates an instance of SbePartnerInfo class. - */ - public SbePartnerInfo() { - } - - /** - * Get the sbeDeploymentInfo property: SBE package and manifest information for the solution Builder Extension - * staged for AzureStackHCI cluster deployment. - * - * @return the sbeDeploymentInfo value. - */ - public SbeDeploymentInfo sbeDeploymentInfo() { - return this.sbeDeploymentInfo; - } - - /** - * Set the sbeDeploymentInfo property: SBE package and manifest information for the solution Builder Extension - * staged for AzureStackHCI cluster deployment. - * - * @param sbeDeploymentInfo the sbeDeploymentInfo value to set. - * @return the SbePartnerInfo object itself. - */ - public SbePartnerInfo withSbeDeploymentInfo(SbeDeploymentInfo sbeDeploymentInfo) { - this.sbeDeploymentInfo = sbeDeploymentInfo; - return this; - } - - /** - * Get the partnerProperties property: List of SBE partner properties for AzureStackHCI cluster deployment. - * - * @return the partnerProperties value. - */ - public List partnerProperties() { - return this.partnerProperties; - } - - /** - * Set the partnerProperties property: List of SBE partner properties for AzureStackHCI cluster deployment. - * - * @param partnerProperties the partnerProperties value to set. - * @return the SbePartnerInfo object itself. - */ - public SbePartnerInfo withPartnerProperties(List partnerProperties) { - this.partnerProperties = partnerProperties; - return this; - } - - /** - * Get the credentialList property: SBE credentials list for AzureStackHCI cluster deployment. - * - * @return the credentialList value. - */ - public List credentialList() { - return this.credentialList; - } - - /** - * Set the credentialList property: SBE credentials list for AzureStackHCI cluster deployment. - * - * @param credentialList the credentialList value to set. - * @return the SbePartnerInfo object itself. - */ - public SbePartnerInfo withCredentialList(List credentialList) { - this.credentialList = credentialList; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sbeDeploymentInfo() != null) { - sbeDeploymentInfo().validate(); - } - if (partnerProperties() != null) { - partnerProperties().forEach(e -> e.validate()); - } - if (credentialList() != null) { - credentialList().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("sbeDeploymentInfo", this.sbeDeploymentInfo); - jsonWriter.writeArrayField("partnerProperties", this.partnerProperties, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("credentialList", this.credentialList, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SbePartnerInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SbePartnerInfo if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SbePartnerInfo. - */ - public static SbePartnerInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SbePartnerInfo deserializedSbePartnerInfo = new SbePartnerInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sbeDeploymentInfo".equals(fieldName)) { - deserializedSbePartnerInfo.sbeDeploymentInfo = SbeDeploymentInfo.fromJson(reader); - } else if ("partnerProperties".equals(fieldName)) { - List partnerProperties - = reader.readArray(reader1 -> SbePartnerProperties.fromJson(reader1)); - deserializedSbePartnerInfo.partnerProperties = partnerProperties; - } else if ("credentialList".equals(fieldName)) { - List credentialList = reader.readArray(reader1 -> SbeCredentials.fromJson(reader1)); - deserializedSbePartnerInfo.credentialList = credentialList; - } else { - reader.skipChildren(); - } - } - - return deserializedSbePartnerInfo; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.java index 0974a442d0ea..55616d9f4453 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.java @@ -22,11 +22,6 @@ public final class ScaleUnits implements JsonSerializable { */ private DeploymentData deploymentData; - /* - * Solution builder extension (SBE) partner properties - */ - private SbePartnerInfo sbePartnerInfo; - /** * Creates an instance of ScaleUnits class. */ @@ -53,26 +48,6 @@ public ScaleUnits withDeploymentData(DeploymentData deploymentData) { return this; } - /** - * Get the sbePartnerInfo property: Solution builder extension (SBE) partner properties. - * - * @return the sbePartnerInfo value. - */ - public SbePartnerInfo sbePartnerInfo() { - return this.sbePartnerInfo; - } - - /** - * Set the sbePartnerInfo property: Solution builder extension (SBE) partner properties. - * - * @param sbePartnerInfo the sbePartnerInfo value to set. - * @return the ScaleUnits object itself. - */ - public ScaleUnits withSbePartnerInfo(SbePartnerInfo sbePartnerInfo) { - this.sbePartnerInfo = sbePartnerInfo; - return this; - } - /** * Validates the instance. * @@ -85,9 +60,6 @@ public void validate() { } else { deploymentData().validate(); } - if (sbePartnerInfo() != null) { - sbePartnerInfo().validate(); - } } private static final ClientLogger LOGGER = new ClientLogger(ScaleUnits.class); @@ -99,7 +71,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("deploymentData", this.deploymentData); - jsonWriter.writeJsonField("sbePartnerInfo", this.sbePartnerInfo); return jsonWriter.writeEndObject(); } @@ -121,8 +92,6 @@ public static ScaleUnits fromJson(JsonReader jsonReader) throws IOException { if ("deploymentData".equals(fieldName)) { deserializedScaleUnits.deploymentData = DeploymentData.fromJson(reader); - } else if ("sbePartnerInfo".equals(fieldName)) { - deserializedScaleUnits.sbePartnerInfo = SbePartnerInfo.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SdnIntegration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SdnIntegration.java deleted file mode 100644 index 06ca4cc2b1f0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SdnIntegration.java +++ /dev/null @@ -1,98 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * SDN Integration config to deploy AzureStackHCI Cluster. - */ -@Fluent -public final class SdnIntegration implements JsonSerializable { - /* - * network controller config for SDN Integration to deploy AzureStackHCI Cluster. - */ - private NetworkController networkController; - - /** - * Creates an instance of SdnIntegration class. - */ - public SdnIntegration() { - } - - /** - * Get the networkController property: network controller config for SDN Integration to deploy AzureStackHCI - * Cluster. - * - * @return the networkController value. - */ - public NetworkController networkController() { - return this.networkController; - } - - /** - * Set the networkController property: network controller config for SDN Integration to deploy AzureStackHCI - * Cluster. - * - * @param networkController the networkController value to set. - * @return the SdnIntegration object itself. - */ - public SdnIntegration withNetworkController(NetworkController networkController) { - this.networkController = networkController; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkController() != null) { - networkController().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("networkController", this.networkController); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SdnIntegration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SdnIntegration if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SdnIntegration. - */ - public static SdnIntegration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SdnIntegration deserializedSdnIntegration = new SdnIntegration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("networkController".equals(fieldName)) { - deserializedSdnIntegration.networkController = NetworkController.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSdnIntegration; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySetting.java index 33575c5e87d4..87dcdc2d96cd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySetting.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySetting.java @@ -47,21 +47,6 @@ public interface SecuritySetting { */ ComplianceAssignmentType securedCoreComplianceAssignment(); - /** - * Gets the wdacComplianceAssignment property: WDAC Compliance Assignment. - * - * @return the wdacComplianceAssignment value. - */ - ComplianceAssignmentType wdacComplianceAssignment(); - - /** - * Gets the smbEncryptionForIntraClusterTrafficComplianceAssignment property: SMB encryption for intra-cluster - * traffic Compliance Assignment. - * - * @return the smbEncryptionForIntraClusterTrafficComplianceAssignment value. - */ - ComplianceAssignmentType smbEncryptionForIntraClusterTrafficComplianceAssignment(); - /** * Gets the securityComplianceStatus property: Security Compliance Status. * @@ -126,9 +111,7 @@ interface WithParentResource { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithSecuredCoreComplianceAssignment, DefinitionStages.WithWdacComplianceAssignment, - DefinitionStages.WithSmbEncryptionForIntraClusterTrafficComplianceAssignment, - DefinitionStages.WithProvisioningState { + extends DefinitionStages.WithSecuredCoreComplianceAssignment, DefinitionStages.WithProvisioningState { /** * Executes the create request. * @@ -158,36 +141,6 @@ interface WithSecuredCoreComplianceAssignment { WithCreate withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment); } - /** - * The stage of the SecuritySetting definition allowing to specify wdacComplianceAssignment. - */ - interface WithWdacComplianceAssignment { - /** - * Specifies the wdacComplianceAssignment property: WDAC Compliance Assignment. - * - * @param wdacComplianceAssignment WDAC Compliance Assignment. - * @return the next definition stage. - */ - WithCreate withWdacComplianceAssignment(ComplianceAssignmentType wdacComplianceAssignment); - } - - /** - * The stage of the SecuritySetting definition allowing to specify - * smbEncryptionForIntraClusterTrafficComplianceAssignment. - */ - interface WithSmbEncryptionForIntraClusterTrafficComplianceAssignment { - /** - * Specifies the smbEncryptionForIntraClusterTrafficComplianceAssignment property: SMB encryption for - * intra-cluster traffic Compliance Assignment. - * - * @param smbEncryptionForIntraClusterTrafficComplianceAssignment SMB encryption for intra-cluster traffic - * Compliance Assignment. - * @return the next definition stage. - */ - WithCreate withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - ComplianceAssignmentType smbEncryptionForIntraClusterTrafficComplianceAssignment); - } - /** * The stage of the SecuritySetting definition allowing to specify provisioningState. */ @@ -212,9 +165,7 @@ interface WithProvisioningState { /** * The template for SecuritySetting update. */ - interface Update - extends UpdateStages.WithSecuredCoreComplianceAssignment, UpdateStages.WithWdacComplianceAssignment, - UpdateStages.WithSmbEncryptionForIntraClusterTrafficComplianceAssignment, UpdateStages.WithProvisioningState { + interface Update extends UpdateStages.WithSecuredCoreComplianceAssignment, UpdateStages.WithProvisioningState { /** * Executes the update request. * @@ -248,36 +199,6 @@ interface WithSecuredCoreComplianceAssignment { Update withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment); } - /** - * The stage of the SecuritySetting update allowing to specify wdacComplianceAssignment. - */ - interface WithWdacComplianceAssignment { - /** - * Specifies the wdacComplianceAssignment property: WDAC Compliance Assignment. - * - * @param wdacComplianceAssignment WDAC Compliance Assignment. - * @return the next definition stage. - */ - Update withWdacComplianceAssignment(ComplianceAssignmentType wdacComplianceAssignment); - } - - /** - * The stage of the SecuritySetting update allowing to specify - * smbEncryptionForIntraClusterTrafficComplianceAssignment. - */ - interface WithSmbEncryptionForIntraClusterTrafficComplianceAssignment { - /** - * Specifies the smbEncryptionForIntraClusterTrafficComplianceAssignment property: SMB encryption for - * intra-cluster traffic Compliance Assignment. - * - * @param smbEncryptionForIntraClusterTrafficComplianceAssignment SMB encryption for intra-cluster traffic - * Compliance Assignment. - * @return the next definition stage. - */ - Update withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - ComplianceAssignmentType smbEncryptionForIntraClusterTrafficComplianceAssignment); - } - /** * The stage of the SecuritySetting update allowing to specify provisioningState. */ 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 000000000000..08620dc47924 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityTypes.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.util.ExpandableStringEnum; +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. + */ + 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 000000000000..c45b95b397d8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshConfiguration.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * SSH configuration for Linux based VMs running on Azure. + */ +@Fluent +public final class SshConfiguration implements JsonSerializable { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicKeys", this.publicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshConfiguration. + */ + public static SshConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshConfiguration deserializedSshConfiguration = new SshConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKeys".equals(fieldName)) { + List publicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedSshConfiguration.publicKeys = publicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedSshConfiguration; + }); + } +} 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 000000000000..88981782b2c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SshPublicKey.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * 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 + */ + 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). + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("keyData", this.keyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedSshPublicKey.path = reader.getString(); + } else if ("keyData".equals(fieldName)) { + deserializedSshPublicKey.keyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } +} 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 000000000000..bd306c57fa3d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusTypes.java @@ -0,0 +1,56 @@ +// Copyright (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 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. + */ + 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 000000000000..e05a8195dedb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatus.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of storage containers. + */ +@Fluent +public final class StorageContainerStatus implements JsonSerializable { + /* + * StorageContainer provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * Amount of space available on the disk in MB + */ + private Long availableSizeMB; + + /* + * Total size of the disk in MB + */ + private Long containerSizeMB; + + /* + * The provisioningStatus property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeNumberField("availableSizeMB", this.availableSizeMB); + jsonWriter.writeNumberField("containerSizeMB", this.containerSizeMB); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainerStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainerStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageContainerStatus. + */ + public static StorageContainerStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainerStatus deserializedStorageContainerStatus = new StorageContainerStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedStorageContainerStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedStorageContainerStatus.errorMessage = reader.getString(); + } else if ("availableSizeMB".equals(fieldName)) { + deserializedStorageContainerStatus.availableSizeMB = reader.getNullable(JsonReader::getLong); + } else if ("containerSizeMB".equals(fieldName)) { + deserializedStorageContainerStatus.containerSizeMB = reader.getNullable(JsonReader::getLong); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedStorageContainerStatus.provisioningStatus + = StorageContainerStatusProvisioningStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainerStatus; + }); + } +} 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 000000000000..c0937558fc4c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainerStatusProvisioningStatus.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The StorageContainerStatusProvisioningStatus model. + */ +@Fluent +public final class StorageContainerStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the storage container + */ + private String operationId; + + /* + * The status of the operation performed on the storage container [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainerStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainerStatusProvisioningStatus if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageContainerStatusProvisioningStatus. + */ + public static StorageContainerStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainerStatusProvisioningStatus deserializedStorageContainerStatusProvisioningStatus + = new StorageContainerStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedStorageContainerStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedStorageContainerStatusProvisioningStatus.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainerStatusProvisioningStatus; + }); + } +} 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 000000000000..5c703074eb36 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainers.java @@ -0,0 +1,287 @@ +// Copyright (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 000000000000..7d47cc6618e4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersListResult.java @@ -0,0 +1,128 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; +import java.io.IOException; +import java.util.List; + +/** + * The StorageContainersListResult model. + */ +@Fluent +public final class StorageContainersListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainersListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainersListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageContainersListResult. + */ + public static StorageContainersListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainersListResult deserializedStorageContainersListResult = new StorageContainersListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageContainersInner.fromJson(reader1)); + deserializedStorageContainersListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageContainersListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainersListResult; + }); + } +} 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 000000000000..81970d075ceb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersOperations.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.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 000000000000..ffec46cc43be --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageContainersUpdateRequest.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The storage container resource patch definition. + */ +@Fluent +public final class StorageContainersUpdateRequest implements JsonSerializable { + /* + * Resource tags + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageContainersUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageContainersUpdateRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageContainersUpdateRequest. + */ + public static StorageContainersUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageContainersUpdateRequest deserializedStorageContainersUpdateRequest + = new StorageContainersUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageContainersUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageContainersUpdateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageNetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageNetworks.java similarity index 52% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageNetworks.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageNetworks.java index 40276457bf2d..16a9f8c45392 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingStorageNetworks.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageNetworks.java @@ -10,13 +10,12 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.List; /** * The StorageNetworks of a cluster. */ @Fluent -public final class DeploymentSettingStorageNetworks implements JsonSerializable { +public final class StorageNetworks implements JsonSerializable { /* * Name of the storage network. */ @@ -33,15 +32,10 @@ public final class DeploymentSettingStorageNetworks implements JsonSerializable< */ private String vlanId; - /* - * List of Storage adapter physical nodes config to deploy AzureStackHCI Cluster. - */ - private List storageAdapterIpInfo; - /** - * Creates an instance of DeploymentSettingStorageNetworks class. + * Creates an instance of StorageNetworks class. */ - public DeploymentSettingStorageNetworks() { + public StorageNetworks() { } /** @@ -57,9 +51,9 @@ public String name() { * Set the name property: Name of the storage network. * * @param name the name value to set. - * @return the DeploymentSettingStorageNetworks object itself. + * @return the StorageNetworks object itself. */ - public DeploymentSettingStorageNetworks withName(String name) { + public StorageNetworks withName(String name) { this.name = name; return this; } @@ -77,9 +71,9 @@ public String networkAdapterName() { * Set the networkAdapterName property: Name of the storage network adapter. * * @param networkAdapterName the networkAdapterName value to set. - * @return the DeploymentSettingStorageNetworks object itself. + * @return the StorageNetworks object itself. */ - public DeploymentSettingStorageNetworks withNetworkAdapterName(String networkAdapterName) { + public StorageNetworks withNetworkAdapterName(String networkAdapterName) { this.networkAdapterName = networkAdapterName; return this; } @@ -99,45 +93,19 @@ public String vlanId() { * interfaces that route the storage and VM migration traffic. * * @param vlanId the vlanId value to set. - * @return the DeploymentSettingStorageNetworks object itself. + * @return the StorageNetworks object itself. */ - public DeploymentSettingStorageNetworks withVlanId(String vlanId) { + public StorageNetworks withVlanId(String vlanId) { this.vlanId = vlanId; return this; } - /** - * Get the storageAdapterIpInfo property: List of Storage adapter physical nodes config to deploy AzureStackHCI - * Cluster. - * - * @return the storageAdapterIpInfo value. - */ - public List storageAdapterIpInfo() { - return this.storageAdapterIpInfo; - } - - /** - * Set the storageAdapterIpInfo property: List of Storage adapter physical nodes config to deploy AzureStackHCI - * Cluster. - * - * @param storageAdapterIpInfo the storageAdapterIpInfo value to set. - * @return the DeploymentSettingStorageNetworks object itself. - */ - public DeploymentSettingStorageNetworks - withStorageAdapterIpInfo(List storageAdapterIpInfo) { - this.storageAdapterIpInfo = storageAdapterIpInfo; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (storageAdapterIpInfo() != null) { - storageAdapterIpInfo().forEach(e -> e.validate()); - } } /** @@ -149,43 +117,36 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("networkAdapterName", this.networkAdapterName); jsonWriter.writeStringField("vlanId", this.vlanId); - jsonWriter.writeArrayField("storageAdapterIPInfo", this.storageAdapterIpInfo, - (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } /** - * Reads an instance of DeploymentSettingStorageNetworks from the JsonReader. + * Reads an instance of StorageNetworks from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingStorageNetworks if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingStorageNetworks. + * @return An instance of StorageNetworks if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageNetworks. */ - public static DeploymentSettingStorageNetworks fromJson(JsonReader jsonReader) throws IOException { + public static StorageNetworks fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - DeploymentSettingStorageNetworks deserializedDeploymentSettingStorageNetworks - = new DeploymentSettingStorageNetworks(); + StorageNetworks deserializedStorageNetworks = new StorageNetworks(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { - deserializedDeploymentSettingStorageNetworks.name = reader.getString(); + deserializedStorageNetworks.name = reader.getString(); } else if ("networkAdapterName".equals(fieldName)) { - deserializedDeploymentSettingStorageNetworks.networkAdapterName = reader.getString(); + deserializedStorageNetworks.networkAdapterName = reader.getString(); } else if ("vlanId".equals(fieldName)) { - deserializedDeploymentSettingStorageNetworks.vlanId = reader.getString(); - } else if ("storageAdapterIPInfo".equals(fieldName)) { - List storageAdapterIpInfo - = reader.readArray(reader1 -> DeploymentSettingStorageAdapterIpInfo.fromJson(reader1)); - deserializedDeploymentSettingStorageNetworks.storageAdapterIpInfo = storageAdapterIpInfo; + deserializedStorageNetworks.vlanId = reader.getString(); } else { reader.skipChildren(); } } - return deserializedDeploymentSettingStorageNetworks; + return deserializedStorageNetworks; }); } } 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 000000000000..f0576951028e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java @@ -0,0 +1,99 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The StorageProfileUpdate model. + */ +@Fluent +public final class StorageProfileUpdate implements JsonSerializable { + /* + * adds data disks to the virtual machine instance for the update call + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataDisks", this.dataDisks, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfileUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageProfileUpdate. + */ + public static StorageProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfileUpdate deserializedStorageProfileUpdate = new StorageProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDisks".equals(fieldName)) { + List dataDisks + = reader.readArray(reader1 -> StorageProfileUpdateDataDisksItem.fromJson(reader1)); + deserializedStorageProfileUpdate.dataDisks = dataDisks; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfileUpdate; + }); + } +} 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 000000000000..75215a263a47 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The StorageProfileUpdateDataDisksItem model. + */ +@Fluent +public final class StorageProfileUpdateDataDisksItem implements JsonSerializable { + /* + * The id property. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfileUpdateDataDisksItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfileUpdateDataDisksItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageProfileUpdateDataDisksItem. + */ + public static StorageProfileUpdateDataDisksItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfileUpdateDataDisksItem deserializedStorageProfileUpdateDataDisksItem + = new StorageProfileUpdateDataDisksItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageProfileUpdateDataDisksItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfileUpdateDataDisksItem; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Subnet.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Subnet.java new file mode 100644 index 000000000000..3aa8750d4a73 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Subnet.java @@ -0,0 +1,282 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.SubnetPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * The Subnet model. + */ +@Fluent +public final class Subnet implements JsonSerializable { + /* + * Properties of the subnet. + */ + private SubnetPropertiesFormat innerProperties; + + /* + * Name - The name of the resource that is unique within a resource group. This name can be used to access the + * resource. + */ + private String name; + + /** + * Creates an instance of Subnet class. + */ + public Subnet() { + } + + /** + * Get the innerProperties property: Properties of the subnet. + * + * @return the innerProperties value. + */ + private SubnetPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 Subnet object itself. + */ + public Subnet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the addressPrefix property: The address prefix for the subnet: 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: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Subnet object itself. + */ + public Subnet withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the addressPrefixes property: 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: List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the Subnet object itself. + */ + public Subnet withAddressPrefixes(List addressPrefixes) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + 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 Subnet object itself. + */ + public Subnet withIpAllocationMethod(IpAllocationMethodEnum ipAllocationMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + 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 Subnet object itself. + */ + public Subnet withIpConfigurationReferences( + List ipConfigurationReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + this.innerProperties().withIpConfigurationReferences(ipConfigurationReferences); + return this; + } + + /** + * Get the routeTable property: Route table resource. + * + * @return the routeTable value. + */ + public RouteTable routeTable() { + return this.innerProperties() == null ? null : this.innerProperties().routeTable(); + } + + /** + * Set the routeTable property: Route table resource. + * + * @param routeTable the routeTable value to set. + * @return the Subnet object itself. + */ + public Subnet withRouteTable(RouteTable routeTable) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + this.innerProperties().withRouteTable(routeTable); + return this; + } + + /** + * Get the ipPools property: network associated pool of IP Addresses. + * + * @return the ipPools value. + */ + public List ipPools() { + return this.innerProperties() == null ? null : this.innerProperties().ipPools(); + } + + /** + * Set the ipPools property: network associated pool of IP Addresses. + * + * @param ipPools the ipPools value to set. + * @return the Subnet object itself. + */ + public Subnet withIpPools(List ipPools) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + this.innerProperties().withIpPools(ipPools); + 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 Subnet object itself. + */ + public Subnet withVlan(Integer vlan) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormat(); + } + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Subnet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Subnet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Subnet. + */ + public static Subnet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Subnet deserializedSubnet = new Subnet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSubnet.innerProperties = SubnetPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedSubnet.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnet; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SubnetPropertiesFormatIpConfigurationReferencesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SubnetPropertiesFormatIpConfigurationReferencesItem.java new file mode 100644 index 000000000000..35d2a78a4ff9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SubnetPropertiesFormatIpConfigurationReferencesItem.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IPConfigurationReference - Describes a IPConfiguration under the virtual network. + */ +@Fluent +public final class SubnetPropertiesFormatIpConfigurationReferencesItem + implements JsonSerializable { + /* + * IPConfigurationID + */ + private String id; + + /** + * Creates an instance of SubnetPropertiesFormatIpConfigurationReferencesItem class. + */ + public SubnetPropertiesFormatIpConfigurationReferencesItem() { + } + + /** + * 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 SubnetPropertiesFormatIpConfigurationReferencesItem object itself. + */ + public SubnetPropertiesFormatIpConfigurationReferencesItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ID", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetPropertiesFormatIpConfigurationReferencesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetPropertiesFormatIpConfigurationReferencesItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetPropertiesFormatIpConfigurationReferencesItem. + */ + public static SubnetPropertiesFormatIpConfigurationReferencesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + SubnetPropertiesFormatIpConfigurationReferencesItem deserializedSubnetPropertiesFormatIpConfigurationReferencesItem + = new SubnetPropertiesFormatIpConfigurationReferencesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ID".equals(fieldName)) { + deserializedSubnetPropertiesFormatIpConfigurationReferencesItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetPropertiesFormatIpConfigurationReferencesItem; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchDetail.java deleted file mode 100644 index efbfd8de8bbe..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchDetail.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.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * List of switch details for edge device. - */ -@Immutable -public final class SwitchDetail implements JsonSerializable { - /* - * The name of the switch. - */ - private String switchName; - - /* - * The type of the switch. e.g. external, internal. - */ - private String switchType; - - /* - * This represents extensions installed on virtualSwitch. - */ - private List extensions; - - /** - * Creates an instance of SwitchDetail class. - */ - public SwitchDetail() { - } - - /** - * Get the switchName property: The name of the switch. - * - * @return the switchName value. - */ - public String switchName() { - return this.switchName; - } - - /** - * Get the switchType property: The type of the switch. e.g. external, internal. - * - * @return the switchType value. - */ - public String switchType() { - return this.switchType; - } - - /** - * Get the extensions property: This represents extensions installed on virtualSwitch. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SwitchDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SwitchDetail if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SwitchDetail. - */ - public static SwitchDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SwitchDetail deserializedSwitchDetail = new SwitchDetail(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("switchName".equals(fieldName)) { - deserializedSwitchDetail.switchName = reader.getString(); - } else if ("switchType".equals(fieldName)) { - deserializedSwitchDetail.switchType = reader.getString(); - } else if ("extensions".equals(fieldName)) { - List extensions = reader.readArray(reader1 -> SwitchExtension.fromJson(reader1)); - deserializedSwitchDetail.extensions = extensions; - } else { - reader.skipChildren(); - } - } - - return deserializedSwitchDetail; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchExtension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchExtension.java deleted file mode 100644 index e07874272312..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SwitchExtension.java +++ /dev/null @@ -1,113 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * This represents extensions installed on virtualSwitch. - */ -@Immutable -public final class SwitchExtension implements JsonSerializable { - /* - * Unique identifier for virtualSwitch. - */ - private String switchId; - - /* - * This will show extension name for virtualSwitch. - */ - private String extensionName; - - /* - * This represents whether extension is enabled on virtualSwitch. - */ - private Boolean extensionEnabled; - - /** - * Creates an instance of SwitchExtension class. - */ - public SwitchExtension() { - } - - /** - * Get the switchId property: Unique identifier for virtualSwitch. - * - * @return the switchId value. - */ - public String switchId() { - return this.switchId; - } - - /** - * Get the extensionName property: This will show extension name for virtualSwitch. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Get the extensionEnabled property: This represents whether extension is enabled on virtualSwitch. - * - * @return the extensionEnabled value. - */ - public Boolean extensionEnabled() { - return this.extensionEnabled; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SwitchExtension from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SwitchExtension if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SwitchExtension. - */ - public static SwitchExtension fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SwitchExtension deserializedSwitchExtension = new SwitchExtension(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("switchId".equals(fieldName)) { - deserializedSwitchExtension.switchId = reader.getString(); - } else if ("extensionName".equals(fieldName)) { - deserializedSwitchExtension.extensionName = reader.getString(); - } else if ("extensionEnabled".equals(fieldName)) { - deserializedSwitchExtension.extensionEnabled = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedSwitchExtension; - }); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java index 9506a95cf33e..4d163de757e2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java @@ -136,14 +136,6 @@ public interface UpdateRun { */ OffsetDateTime lastUpdatedTimeUtc(); - /** - * Gets the expectedExecutionTime property: Expected execution time of a given step. This is optionally authored in - * the update action plan and can be empty. - * - * @return the expectedExecutionTime value. - */ - String expectedExecutionTime(); - /** * Gets the steps property: Recursive model for child steps of this step. * @@ -219,8 +211,7 @@ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.Wit DefinitionStages.WithLastUpdatedTime, DefinitionStages.WithDuration, DefinitionStages.WithState, DefinitionStages.WithNamePropertiesName, DefinitionStages.WithDescription, DefinitionStages.WithErrorMessage, DefinitionStages.WithStatus, DefinitionStages.WithStartTimeUtc, - DefinitionStages.WithEndTimeUtc, DefinitionStages.WithLastUpdatedTimeUtc, - DefinitionStages.WithExpectedExecutionTime, DefinitionStages.WithSteps { + DefinitionStages.WithEndTimeUtc, DefinitionStages.WithLastUpdatedTimeUtc, DefinitionStages.WithSteps { /** * Executes the create request. * @@ -403,21 +394,6 @@ interface WithLastUpdatedTimeUtc { WithCreate withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); } - /** - * The stage of the UpdateRun definition allowing to specify expectedExecutionTime. - */ - interface WithExpectedExecutionTime { - /** - * Specifies the expectedExecutionTime property: Expected execution time of a given step. This is optionally - * authored in the update action plan and can be empty.. - * - * @param expectedExecutionTime Expected execution time of a given step. This is optionally authored in the - * update action plan and can be empty. - * @return the next definition stage. - */ - WithCreate withExpectedExecutionTime(String expectedExecutionTime); - } - /** * The stage of the UpdateRun definition allowing to specify steps. */ @@ -445,8 +421,7 @@ interface WithSteps { interface Update extends UpdateStages.WithTimeStarted, UpdateStages.WithLastUpdatedTime, UpdateStages.WithDuration, UpdateStages.WithState, UpdateStages.WithNamePropertiesName, UpdateStages.WithDescription, UpdateStages.WithErrorMessage, UpdateStages.WithStatus, UpdateStages.WithStartTimeUtc, - UpdateStages.WithEndTimeUtc, UpdateStages.WithLastUpdatedTimeUtc, UpdateStages.WithExpectedExecutionTime, - UpdateStages.WithSteps { + UpdateStages.WithEndTimeUtc, UpdateStages.WithLastUpdatedTimeUtc, UpdateStages.WithSteps { /** * Executes the update request. * @@ -612,21 +587,6 @@ interface WithLastUpdatedTimeUtc { Update withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); } - /** - * The stage of the UpdateRun update allowing to specify expectedExecutionTime. - */ - interface WithExpectedExecutionTime { - /** - * Specifies the expectedExecutionTime property: Expected execution time of a given step. This is optionally - * authored in the update action plan and can be empty.. - * - * @param expectedExecutionTime Expected execution time of a given step. This is optionally authored in the - * update action plan and can be empty. - * @return the next definition stage. - */ - Update withExpectedExecutionTime(String expectedExecutionTime); - } - /** * The stage of the UpdateRun update allowing to specify steps. */ diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java index 1027ab9b6aca..8e4b4f3b2d55 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java @@ -62,13 +62,6 @@ public interface UpdateSummaries { */ String oemFamily(); - /** - * Gets the currentOemVersion property: Current OEM Version. - * - * @return the currentOemVersion value. - */ - String currentOemVersion(); - /** * Gets the hardwareModel property: Name of the hardware model. * @@ -90,13 +83,6 @@ public interface UpdateSummaries { */ String currentVersion(); - /** - * Gets the currentSbeVersion property: Current Sbe version of the stamp. - * - * @return the currentSbeVersion value. - */ - String currentSbeVersion(); - /** * Gets the lastUpdated property: Last time an update installation completed successfully. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateRequest.java index c960092f2b69..411ce695606b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateRequest.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateRequest.java @@ -24,7 +24,7 @@ public final class ValidateRequest implements JsonSerializable private List edgeDeviceIds; /* - * Additional info required for validation. + * additional Info required for validation */ private String additionalInfo; @@ -55,7 +55,7 @@ public ValidateRequest withEdgeDeviceIds(List edgeDeviceIds) { } /** - * Get the additionalInfo property: Additional info required for validation. + * Get the additionalInfo property: additional Info required for validation. * * @return the additionalInfo value. */ @@ -64,7 +64,7 @@ public String additionalInfo() { } /** - * Set the additionalInfo property: Additional info required for validation. + * Set the additionalInfo property: additional Info required for validation. * * @param additionalInfo the additionalInfo value to set. * @return the ValidateRequest object itself. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidationStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidationStatus.java new file mode 100644 index 000000000000..a7d201815da3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidationStatus.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ValidationStatus of AzureStackHCI Cluster. + */ +@Immutable +public final class ValidationStatus implements JsonSerializable { + /* + * Status of AzureStackHCI Cluster Deployment. + */ + private String status; + + /* + * List of steps of AzureStackHCI Cluster Deployment. + */ + private List steps; + + /** + * Creates an instance of ValidationStatus class. + */ + public ValidationStatus() { + } + + /** + * Get the status property: Status of AzureStackHCI Cluster Deployment. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the steps property: List of steps of AzureStackHCI Cluster Deployment. + * + * @return the steps value. + */ + public List steps() { + return this.steps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (steps() != null) { + steps().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationStatus. + */ + public static ValidationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationStatus deserializedValidationStatus = new ValidationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidationStatus.status = reader.getString(); + } else if ("steps".equals(fieldName)) { + List steps = reader.readArray(reader1 -> DeploymentStep.fromJson(reader1)); + deserializedValidationStatus.steps = steps; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationStatus; + }); + } +} 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 000000000000..f0c99ae74104 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatus.java @@ -0,0 +1,153 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of virtual hard disks. + */ +@Fluent +public final class VirtualHardDiskStatus implements JsonSerializable { + /* + * VirtualHardDisk provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The provisioningStatus property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDiskStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDiskStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDiskStatus. + */ + public static VirtualHardDiskStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDiskStatus deserializedVirtualHardDiskStatus = new VirtualHardDiskStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedVirtualHardDiskStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedVirtualHardDiskStatus.errorMessage = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedVirtualHardDiskStatus.provisioningStatus + = VirtualHardDiskStatusProvisioningStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDiskStatus; + }); + } +} 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 000000000000..7383c5dc2905 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDiskStatusProvisioningStatus.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualHardDiskStatusProvisioningStatus model. + */ +@Fluent +public final class VirtualHardDiskStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the virtual hard disk + */ + private String operationId; + + /* + * The status of the operation performed on the virtual hard disk [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDiskStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDiskStatusProvisioningStatus if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDiskStatusProvisioningStatus. + */ + public static VirtualHardDiskStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDiskStatusProvisioningStatus deserializedVirtualHardDiskStatusProvisioningStatus + = new VirtualHardDiskStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedVirtualHardDiskStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedVirtualHardDiskStatusProvisioningStatus.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDiskStatusProvisioningStatus; + }); + } +} 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 000000000000..7dee31fa9b1d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisks.java @@ -0,0 +1,430 @@ +// Copyright (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 000000000000..7689169d4a1b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksListResult.java @@ -0,0 +1,128 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; +import java.io.IOException; +import java.util.List; + +/** + * The VirtualHardDisksListResult model. + */ +@Fluent +public final class VirtualHardDisksListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDisksListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDisksListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDisksListResult. + */ + public static VirtualHardDisksListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDisksListResult deserializedVirtualHardDisksListResult = new VirtualHardDisksListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualHardDisksInner.fromJson(reader1)); + deserializedVirtualHardDisksListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualHardDisksListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDisksListResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.java new file mode 100644 index 000000000000..d4be8cbb4337 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksOperations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of VirtualHardDisksOperations. + */ +public interface VirtualHardDisksOperations { + /** + * 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 a virtual hard disk along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualHardDiskName, + 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 com.azure.core.management.exception.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. + */ + VirtualHardDisks getByResourceGroup(String resourceGroupName, String virtualHardDiskName); + + /** + * 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 com.azure.core.management.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 virtualHardDiskName); + + /** + * 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 com.azure.core.management.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 virtualHardDiskName, Context 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 com.azure.core.management.exception.ManagementException 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 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 com.azure.core.management.exception.ManagementException 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 hard disks in the specified subscription. Use the nextLink property in the response to + * get the next page of virtual hard disks. + * + * @throws com.azure.core.management.exception.ManagementException 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 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 com.azure.core.management.exception.ManagementException 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 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 a virtual hard disk along with {@link Response}. + */ + VirtualHardDisks getById(String id); + + /** + * 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 a virtual hard disk along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete 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. + */ + void deleteById(String id); + + /** + * The operation to delete 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualHardDisks resource. + * + * @param name resource name. + * @return the first stage of the new VirtualHardDisks definition. + */ + 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 000000000000..7265dd0a484d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualHardDisksUpdateRequest.java @@ -0,0 +1,96 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The virtual hard disk resource patch definition. + */ +@Fluent +public final class VirtualHardDisksUpdateRequest implements JsonSerializable { + /* + * Resource tags + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDisksUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDisksUpdateRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDisksUpdateRequest. + */ + public static VirtualHardDisksUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDisksUpdateRequest deserializedVirtualHardDisksUpdateRequest + = new VirtualHardDisksUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualHardDisksUpdateRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDisksUpdateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineConfigAgentInstanceView.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineConfigAgentInstanceView.java new file mode 100644 index 000000000000..d2328c173c13 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineConfigAgentInstanceView.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The instance view of the VM Config Agent running on the virtual machine. + */ +@Fluent +public final class VirtualMachineConfigAgentInstanceView + implements JsonSerializable { + /* + * The VM Config Agent full version. + */ + private String vmConfigAgentVersion; + + /* + * The resource status information. + */ + private List statuses; + + /** + * Creates an instance of VirtualMachineConfigAgentInstanceView class. + */ + public VirtualMachineConfigAgentInstanceView() { + } + + /** + * 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 VirtualMachineConfigAgentInstanceView object itself. + */ + public VirtualMachineConfigAgentInstanceView 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 VirtualMachineConfigAgentInstanceView object itself. + */ + public VirtualMachineConfigAgentInstanceView 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmConfigAgentVersion", this.vmConfigAgentVersion); + jsonWriter.writeArrayField("statuses", this.statuses, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineConfigAgentInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineConfigAgentInstanceView if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineConfigAgentInstanceView. + */ + public static VirtualMachineConfigAgentInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineConfigAgentInstanceView deserializedVirtualMachineConfigAgentInstanceView + = new VirtualMachineConfigAgentInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmConfigAgentVersion".equals(fieldName)) { + deserializedVirtualMachineConfigAgentInstanceView.vmConfigAgentVersion = reader.getString(); + } else if ("statuses".equals(fieldName)) { + List statuses + = reader.readArray(reader1 -> InstanceViewStatus.fromJson(reader1)); + deserializedVirtualMachineConfigAgentInstanceView.statuses = statuses; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineConfigAgentInstanceView; + }); + } +} 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 000000000000..00ad077edfa5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstance.java @@ -0,0 +1,150 @@ +// Copyright (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 httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @return the httpProxyConfig value. + */ + HttpProxyConfiguration httpProxyConfig(); + + /** + * 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 000000000000..b3a290c4172b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceListResult.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The VirtualMachineInstanceListResult model. + */ +@Fluent +public final class VirtualMachineInstanceListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceListResult. + */ + public static VirtualMachineInstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceListResult deserializedVirtualMachineInstanceListResult + = new VirtualMachineInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualMachineInstanceInner.fromJson(reader1)); + deserializedVirtualMachineInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualMachineInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceListResult; + }); + } +} 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 000000000000..ee7987cc974c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfile.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesHardwareProfile + implements JsonSerializable { + /* + * The vmSize property. + */ + private VmSizeEnum vmSize; + + /* + * number of processors for the virtual machine instance + */ + private Integer processors; + + /* + * RAM in MB for the virtual machine instance + */ + private Long memoryMB; + + /* + * The dynamicMemoryConfig property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize == null ? null : this.vmSize.toString()); + jsonWriter.writeNumberField("processors", this.processors); + jsonWriter.writeNumberField("memoryMB", this.memoryMB); + jsonWriter.writeJsonField("dynamicMemoryConfig", this.dynamicMemoryConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesHardwareProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesHardwareProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesHardwareProfile. + */ + public static VirtualMachineInstancePropertiesHardwareProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesHardwareProfile deserializedVirtualMachineInstancePropertiesHardwareProfile + = new VirtualMachineInstancePropertiesHardwareProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfile.vmSize + = VmSizeEnum.fromString(reader.getString()); + } else if ("processors".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfile.processors + = reader.getNullable(JsonReader::getInt); + } else if ("memoryMB".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfile.memoryMB + = reader.getNullable(JsonReader::getLong); + } else if ("dynamicMemoryConfig".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfile.dynamicMemoryConfig + = VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesHardwareProfile; + }); + } +} 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 000000000000..ae46f25175ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.java @@ -0,0 +1,167 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig model. + */ +@Fluent +public final class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + implements JsonSerializable { + /* + * The maximumMemoryMB property. + */ + private Long maximumMemoryMB; + + /* + * The minimumMemoryMB property. + */ + 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. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maximumMemoryMB", this.maximumMemoryMB); + jsonWriter.writeNumberField("minimumMemoryMB", this.minimumMemoryMB); + jsonWriter.writeNumberField("targetMemoryBuffer", this.targetMemoryBuffer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig. + */ + public static VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig deserializedVirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + = new VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maximumMemoryMB".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.maximumMemoryMB + = reader.getNullable(JsonReader::getLong); + } else if ("minimumMemoryMB".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.minimumMemoryMB + = reader.getNullable(JsonReader::getLong); + } else if ("targetMemoryBuffer".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.targetMemoryBuffer + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; + }); + } +} 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 000000000000..87b67fd407e8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfile.java @@ -0,0 +1,106 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * NetworkProfile - describes the network configuration the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesNetworkProfile + implements JsonSerializable { + /* + * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesNetworkProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesNetworkProfile. + */ + public static VirtualMachineInstancePropertiesNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesNetworkProfile deserializedVirtualMachineInstancePropertiesNetworkProfile + = new VirtualMachineInstancePropertiesNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces = reader + .readArray(reader1 -> VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem + .fromJson(reader1)); + deserializedVirtualMachineInstancePropertiesNetworkProfile.networkInterfaces = networkInterfaces; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesNetworkProfile; + }); + } +} 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 000000000000..51e9ec97b0d1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem model. + */ +@Fluent +public final class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem + implements JsonSerializable { + /* + * ID - Resource Id of the network interface + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem. + */ + public static VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem deserializedVirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem + = new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.id + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem; + }); + } +} 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 000000000000..2a53d8e14b60 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfile.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OsProfile - describes the configuration of the operating system and sets login data. + */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfile + implements JsonSerializable { + /* + * AdminPassword - admin password + */ + private String adminPassword; + + /* + * AdminUsername - admin username + */ + private String adminUsername; + + /* + * ComputerName - name of the compute + */ + private String computerName; + + /* + * LinuxConfiguration - linux specific configuration values for the virtual machine instance + */ + private VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration; + + /* + * Windows Configuration for the virtual machine instance + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminPassword", this.adminPassword); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeStringField("computerName", this.computerName); + jsonWriter.writeJsonField("linuxConfiguration", this.linuxConfiguration); + jsonWriter.writeJsonField("windowsConfiguration", this.windowsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesOsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesOsProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesOsProfile. + */ + public static VirtualMachineInstancePropertiesOsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesOsProfile deserializedVirtualMachineInstancePropertiesOsProfile + = new VirtualMachineInstancePropertiesOsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminPassword".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfile.adminPassword = reader.getString(); + } else if ("adminUsername".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfile.adminUsername = reader.getString(); + } else if ("computerName".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfile.computerName = reader.getString(); + } else if ("linuxConfiguration".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfile.linuxConfiguration + = VirtualMachineInstancePropertiesOsProfileLinuxConfiguration.fromJson(reader); + } else if ("windowsConfiguration".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfile.windowsConfiguration + = VirtualMachineInstancePropertiesOsProfileWindowsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesOsProfile; + }); + } +} 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 000000000000..12a15a78a734 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileLinuxConfiguration.java @@ -0,0 +1,197 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * LinuxConfiguration - linux specific configuration values for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfileLinuxConfiguration + implements JsonSerializable { + /* + * DisablePasswordAuthentication - whether password authentication should be disabled + */ + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + private SshConfiguration ssh; + + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. + */ + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("disablePasswordAuthentication", this.disablePasswordAuthentication); + jsonWriter.writeJsonField("ssh", this.ssh); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeBooleanField("provisionVMConfigAgent", this.provisionVMConfigAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesOsProfileLinuxConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesOsProfileLinuxConfiguration if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesOsProfileLinuxConfiguration. + */ + public static VirtualMachineInstancePropertiesOsProfileLinuxConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesOsProfileLinuxConfiguration deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration + = new VirtualMachineInstancePropertiesOsProfileLinuxConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disablePasswordAuthentication".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration.disablePasswordAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("ssh".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration.ssh + = SshConfiguration.fromJson(reader); + } else if ("provisionVMAgent".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration.provisionVMAgent + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisionVMConfigAgent".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration.provisionVMConfigAgent + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesOsProfileLinuxConfiguration; + }); + } +} 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 000000000000..4ebb3d13c51d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesOsProfileWindowsConfiguration.java @@ -0,0 +1,225 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Windows Configuration for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesOsProfileWindowsConfiguration + implements JsonSerializable { + /* + * Whether to EnableAutomaticUpdates on the machine + */ + private Boolean enableAutomaticUpdates; + + /* + * Specifies the ssh key configuration for Windows OS. + */ + private SshConfiguration ssh; + + /* + * TimeZone for the virtual machine instance + */ + private String timeZone; + + /* + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. + */ + private Boolean provisionVMAgent; + + /* + * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableAutomaticUpdates", this.enableAutomaticUpdates); + jsonWriter.writeJsonField("ssh", this.ssh); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeBooleanField("provisionVMConfigAgent", this.provisionVMConfigAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesOsProfileWindowsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesOsProfileWindowsConfiguration if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesOsProfileWindowsConfiguration. + */ + public static VirtualMachineInstancePropertiesOsProfileWindowsConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesOsProfileWindowsConfiguration deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration + = new VirtualMachineInstancePropertiesOsProfileWindowsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableAutomaticUpdates".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration.enableAutomaticUpdates + = reader.getNullable(JsonReader::getBoolean); + } else if ("ssh".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration.ssh + = SshConfiguration.fromJson(reader); + } else if ("timeZone".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration.timeZone + = reader.getString(); + } else if ("provisionVMAgent".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration.provisionVMAgent + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisionVMConfigAgent".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration.provisionVMConfigAgent + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesOsProfileWindowsConfiguration; + }); + } +} 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 000000000000..21ede0f32569 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfile.java @@ -0,0 +1,161 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SecurityProfile - Specifies the security settings for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesSecurityProfile + implements JsonSerializable { + /* + * The enableTPM property. + */ + private Boolean enableTpm; + + /* + * The uefiSettings property. + */ + private VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings; + + /* + * Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for + * SecurityType to function. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableTPM", this.enableTpm); + jsonWriter.writeJsonField("uefiSettings", this.uefiSettings); + jsonWriter.writeStringField("securityType", this.securityType == null ? null : this.securityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesSecurityProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesSecurityProfile. + */ + public static VirtualMachineInstancePropertiesSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesSecurityProfile deserializedVirtualMachineInstancePropertiesSecurityProfile + = new VirtualMachineInstancePropertiesSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableTPM".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesSecurityProfile.enableTpm + = reader.getNullable(JsonReader::getBoolean); + } else if ("uefiSettings".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesSecurityProfile.uefiSettings + = VirtualMachineInstancePropertiesSecurityProfileUefiSettings.fromJson(reader); + } else if ("securityType".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesSecurityProfile.securityType + = SecurityTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesSecurityProfile; + }); + } +} 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 000000000000..2cce2f90e06c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesSecurityProfileUefiSettings.java @@ -0,0 +1,101 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineInstancePropertiesSecurityProfileUefiSettings model. + */ +@Fluent +public final class VirtualMachineInstancePropertiesSecurityProfileUefiSettings + implements JsonSerializable { + /* + * Specifies whether secure boot should be enabled on the virtual machine instance. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("secureBootEnabled", this.secureBootEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesSecurityProfileUefiSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesSecurityProfileUefiSettings if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesSecurityProfileUefiSettings. + */ + public static VirtualMachineInstancePropertiesSecurityProfileUefiSettings fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesSecurityProfileUefiSettings deserializedVirtualMachineInstancePropertiesSecurityProfileUefiSettings + = new VirtualMachineInstancePropertiesSecurityProfileUefiSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secureBootEnabled".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesSecurityProfileUefiSettings.secureBootEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesSecurityProfileUefiSettings; + }); + } +} 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 000000000000..b877525c5218 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfile.java @@ -0,0 +1,197 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * StorageProfile - contains information about the disks and storage information for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfile + implements JsonSerializable { + /* + * adds data disks to the virtual machine instance + */ + private List dataDisks; + + /* + * Which Image to use for the virtual machine instance + */ + private VirtualMachineInstancePropertiesStorageProfileImageReference imageReference; + + /* + * VHD to attach as OS disk + */ + private VirtualMachineInstancePropertiesStorageProfileOsDisk osDisk; + + /* + * Id of the storage container that hosts the VM configuration file + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataDisks", this.dataDisks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("imageReference", this.imageReference); + jsonWriter.writeJsonField("osDisk", this.osDisk); + jsonWriter.writeStringField("vmConfigStoragePathId", this.vmConfigStoragePathId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesStorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesStorageProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesStorageProfile. + */ + public static VirtualMachineInstancePropertiesStorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesStorageProfile deserializedVirtualMachineInstancePropertiesStorageProfile + = new VirtualMachineInstancePropertiesStorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDisks".equals(fieldName)) { + List dataDisks = reader.readArray( + reader1 -> VirtualMachineInstancePropertiesStorageProfileDataDisksItem.fromJson(reader1)); + deserializedVirtualMachineInstancePropertiesStorageProfile.dataDisks = dataDisks; + } else if ("imageReference".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfile.imageReference + = VirtualMachineInstancePropertiesStorageProfileImageReference.fromJson(reader); + } else if ("osDisk".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfile.osDisk + = VirtualMachineInstancePropertiesStorageProfileOsDisk.fromJson(reader); + } else if ("vmConfigStoragePathId".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfile.vmConfigStoragePathId + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesStorageProfile; + }); + } +} 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 000000000000..b0135c89cf7a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileDataDisksItem.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineInstancePropertiesStorageProfileDataDisksItem model. + */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileDataDisksItem + implements JsonSerializable { + /* + * Resource ID of the data disk + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesStorageProfileDataDisksItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesStorageProfileDataDisksItem if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesStorageProfileDataDisksItem. + */ + public static VirtualMachineInstancePropertiesStorageProfileDataDisksItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesStorageProfileDataDisksItem deserializedVirtualMachineInstancePropertiesStorageProfileDataDisksItem + = new VirtualMachineInstancePropertiesStorageProfileDataDisksItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfileDataDisksItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesStorageProfileDataDisksItem; + }); + } +} 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 000000000000..499e02d1f238 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileImageReference.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Which Image to use for the virtual machine instance. + */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileImageReference + implements JsonSerializable { + /* + * Resource ID of the image + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesStorageProfileImageReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesStorageProfileImageReference if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * VirtualMachineInstancePropertiesStorageProfileImageReference. + */ + public static VirtualMachineInstancePropertiesStorageProfileImageReference fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesStorageProfileImageReference deserializedVirtualMachineInstancePropertiesStorageProfileImageReference + = new VirtualMachineInstancePropertiesStorageProfileImageReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfileImageReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesStorageProfileImageReference; + }); + } +} 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 000000000000..fdb8fab872a6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstancePropertiesStorageProfileOsDisk.java @@ -0,0 +1,128 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VHD to attach as OS disk. + */ +@Fluent +public final class VirtualMachineInstancePropertiesStorageProfileOsDisk + implements JsonSerializable { + /* + * Resource ID of the OS disk + */ + 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.** + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstancePropertiesStorageProfileOsDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstancePropertiesStorageProfileOsDisk if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstancePropertiesStorageProfileOsDisk. + */ + public static VirtualMachineInstancePropertiesStorageProfileOsDisk fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstancePropertiesStorageProfileOsDisk deserializedVirtualMachineInstancePropertiesStorageProfileOsDisk + = new VirtualMachineInstancePropertiesStorageProfileOsDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfileOsDisk.id = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedVirtualMachineInstancePropertiesStorageProfileOsDisk.osType + = OperatingSystemTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstancePropertiesStorageProfileOsDisk; + }); + } +} 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 000000000000..fac60d01a6e5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatus.java @@ -0,0 +1,182 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The observed state of virtual machine instances. + */ +@Fluent +public final class VirtualMachineInstanceStatus implements JsonSerializable { + /* + * VirtualMachine provisioning error code + */ + private String errorCode; + + /* + * Descriptive error message + */ + private String errorMessage; + + /* + * The power state of the virtual machine instance + */ + private PowerStateEnum powerState; + + /* + * The provisioningStatus property. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeStringField("powerState", this.powerState == null ? null : this.powerState.toString()); + jsonWriter.writeJsonField("provisioningStatus", this.provisioningStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceStatus if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceStatus. + */ + public static VirtualMachineInstanceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceStatus deserializedVirtualMachineInstanceStatus = new VirtualMachineInstanceStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedVirtualMachineInstanceStatus.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedVirtualMachineInstanceStatus.errorMessage = reader.getString(); + } else if ("powerState".equals(fieldName)) { + deserializedVirtualMachineInstanceStatus.powerState = PowerStateEnum.fromString(reader.getString()); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedVirtualMachineInstanceStatus.provisioningStatus + = VirtualMachineInstanceStatusProvisioningStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceStatus; + }); + } +} 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 000000000000..9b3ce5c3cf3b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceStatusProvisioningStatus.java @@ -0,0 +1,126 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineInstanceStatusProvisioningStatus model. + */ +@Fluent +public final class VirtualMachineInstanceStatusProvisioningStatus + implements JsonSerializable { + /* + * The ID of the operation performed on the virtual machine instance + */ + private String operationId; + + /* + * The status of the operation performed on the virtual machine instance [Succeeded, Failed, InProgress] + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceStatusProvisioningStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceStatusProvisioningStatus if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceStatusProvisioningStatus. + */ + public static VirtualMachineInstanceStatusProvisioningStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceStatusProvisioningStatus deserializedVirtualMachineInstanceStatusProvisioningStatus + = new VirtualMachineInstanceStatusProvisioningStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedVirtualMachineInstanceStatusProvisioningStatus.operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedVirtualMachineInstanceStatusProvisioningStatus.status + = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceStatusProvisioningStatus; + }); + } +} 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 000000000000..1266146dc683 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateProperties.java @@ -0,0 +1,198 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the resource properties for the update. + */ +@Fluent +public final class VirtualMachineInstanceUpdateProperties + implements JsonSerializable { + /* + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ + private HardwareProfileUpdate hardwareProfile; + + /* + * The storageProfile property. + */ + private StorageProfileUpdate storageProfile; + + /* + * NetworkProfile - describes the network update configuration the virtual machine instance + */ + private NetworkProfileUpdate networkProfile; + + /* + * OsProfile - describes the update configuration of the operating system + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hardwareProfile", this.hardwareProfile); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("osProfile", this.osProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceUpdateProperties. + */ + public static VirtualMachineInstanceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceUpdateProperties deserializedVirtualMachineInstanceUpdateProperties + = new VirtualMachineInstanceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hardwareProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateProperties.hardwareProfile + = HardwareProfileUpdate.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateProperties.storageProfile + = StorageProfileUpdate.fromJson(reader); + } else if ("networkProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateProperties.networkProfile + = NetworkProfileUpdate.fromJson(reader); + } else if ("osProfile".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateProperties.osProfile = OsProfileUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceUpdateProperties; + }); + } +} 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 000000000000..eedfe4fc2b82 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceUpdateRequest.java @@ -0,0 +1,130 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The virtual machine instance resource patch definition. + */ +@Fluent +public final class VirtualMachineInstanceUpdateRequest + implements JsonSerializable { + /* + * Defines the resource properties for the update. + */ + private VirtualMachineInstanceUpdateProperties properties; + + /* + * Identity for the resource. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceUpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceUpdateRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceUpdateRequest. + */ + public static VirtualMachineInstanceUpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceUpdateRequest deserializedVirtualMachineInstanceUpdateRequest + = new VirtualMachineInstanceUpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateRequest.properties + = VirtualMachineInstanceUpdateProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedVirtualMachineInstanceUpdateRequest.identity = Identity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceUpdateRequest; + }); + } +} 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 000000000000..57f411843dce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstanceView.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The instance view of a virtual machine. + */ +@Fluent +public final class VirtualMachineInstanceView implements JsonSerializable { + /* + * The VM Config Agent running on the virtual machine. + */ + private VirtualMachineConfigAgentInstanceView 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 VirtualMachineConfigAgentInstanceView 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(VirtualMachineConfigAgentInstanceView 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vmAgent", this.vmAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInstanceView if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInstanceView. + */ + public static VirtualMachineInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInstanceView deserializedVirtualMachineInstanceView = new VirtualMachineInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmAgent".equals(fieldName)) { + deserializedVirtualMachineInstanceView.vmAgent + = VirtualMachineConfigAgentInstanceView.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInstanceView; + }); + } +} 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 000000000000..b15b09dac4dc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineInstances.java @@ -0,0 +1,221 @@ +// Copyright (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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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 virtualMachineInstance parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineInstance parameter. + * @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/DeploymentSettingVirtualSwitchConfigurationOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java similarity index 61% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingVirtualSwitchConfigurationOverrides.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java index 7c7ce2850d03..9390ce01f6d7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingVirtualSwitchConfigurationOverrides.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java @@ -15,8 +15,8 @@ * The VirtualSwitchConfigurationOverrides of a cluster. */ @Fluent -public final class DeploymentSettingVirtualSwitchConfigurationOverrides - implements JsonSerializable { +public final class VirtualSwitchConfigurationOverrides + implements JsonSerializable { /* * Enable IoV for Virtual Switch */ @@ -28,9 +28,9 @@ public final class DeploymentSettingVirtualSwitchConfigurationOverrides private String loadBalancingAlgorithm; /** - * Creates an instance of DeploymentSettingVirtualSwitchConfigurationOverrides class. + * Creates an instance of VirtualSwitchConfigurationOverrides class. */ - public DeploymentSettingVirtualSwitchConfigurationOverrides() { + public VirtualSwitchConfigurationOverrides() { } /** @@ -46,9 +46,9 @@ public String enableIov() { * Set the enableIov property: Enable IoV for Virtual Switch. * * @param enableIov the enableIov value to set. - * @return the DeploymentSettingVirtualSwitchConfigurationOverrides object itself. + * @return the VirtualSwitchConfigurationOverrides object itself. */ - public DeploymentSettingVirtualSwitchConfigurationOverrides withEnableIov(String enableIov) { + public VirtualSwitchConfigurationOverrides withEnableIov(String enableIov) { this.enableIov = enableIov; return this; } @@ -66,10 +66,9 @@ public String loadBalancingAlgorithm() { * Set the loadBalancingAlgorithm property: Load Balancing Algorithm for Virtual Switch. * * @param loadBalancingAlgorithm the loadBalancingAlgorithm value to set. - * @return the DeploymentSettingVirtualSwitchConfigurationOverrides object itself. + * @return the VirtualSwitchConfigurationOverrides object itself. */ - public DeploymentSettingVirtualSwitchConfigurationOverrides - withLoadBalancingAlgorithm(String loadBalancingAlgorithm) { + public VirtualSwitchConfigurationOverrides withLoadBalancingAlgorithm(String loadBalancingAlgorithm) { this.loadBalancingAlgorithm = loadBalancingAlgorithm; return this; } @@ -94,33 +93,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of DeploymentSettingVirtualSwitchConfigurationOverrides from the JsonReader. + * Reads an instance of VirtualSwitchConfigurationOverrides from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSettingVirtualSwitchConfigurationOverrides if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DeploymentSettingVirtualSwitchConfigurationOverrides. + * @return An instance of VirtualSwitchConfigurationOverrides if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualSwitchConfigurationOverrides. */ - public static DeploymentSettingVirtualSwitchConfigurationOverrides fromJson(JsonReader jsonReader) - throws IOException { + public static VirtualSwitchConfigurationOverrides fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - DeploymentSettingVirtualSwitchConfigurationOverrides deserializedDeploymentSettingVirtualSwitchConfigurationOverrides - = new DeploymentSettingVirtualSwitchConfigurationOverrides(); + VirtualSwitchConfigurationOverrides deserializedVirtualSwitchConfigurationOverrides + = new VirtualSwitchConfigurationOverrides(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("enableIov".equals(fieldName)) { - deserializedDeploymentSettingVirtualSwitchConfigurationOverrides.enableIov = reader.getString(); + deserializedVirtualSwitchConfigurationOverrides.enableIov = reader.getString(); } else if ("loadBalancingAlgorithm".equals(fieldName)) { - deserializedDeploymentSettingVirtualSwitchConfigurationOverrides.loadBalancingAlgorithm - = reader.getString(); + deserializedVirtualSwitchConfigurationOverrides.loadBalancingAlgorithm = reader.getString(); } else { reader.skipChildren(); } } - return deserializedDeploymentSettingVirtualSwitchConfigurationOverrides; + return deserializedVirtualSwitchConfigurationOverrides; }); } } 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 000000000000..81805b9fed54 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VmSizeEnum.java @@ -0,0 +1,156 @@ +// Copyright (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 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. + */ + 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/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/proxy-config.json b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/proxy-config.json index 2304b88c9c76..1d7c8ea3a8cc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/proxy-config.json +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsClientImpl$ArcSettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.azurestackhci.implementation.DeploymentSettingsClientImpl$DeploymentSettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.EdgeDevicesClientImpl$EdgeDevicesService"],["com.azure.resourcemanager.azurestackhci.implementation.ExtensionsClientImpl$ExtensionsService"],["com.azure.resourcemanager.azurestackhci.implementation.OffersClientImpl$OffersService"],["com.azure.resourcemanager.azurestackhci.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.PublishersClientImpl$PublishersService"],["com.azure.resourcemanager.azurestackhci.implementation.SecuritySettingsClientImpl$SecuritySettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsClientImpl$UpdateRunsService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsClientImpl$UpdateSummariesOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdatesClientImpl$UpdatesService"]] \ No newline at end of file +[["com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsClientImpl$ArcSettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.azurestackhci.implementation.DeploymentSettingsClientImpl$DeploymentSettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.EdgeDevicesClientImpl$EdgeDevicesService"],["com.azure.resourcemanager.azurestackhci.implementation.ExtensionsClientImpl$ExtensionsService"],["com.azure.resourcemanager.azurestackhci.implementation.GalleryImagesOperationsClientImpl$GalleryImagesOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsClientImpl$GuestAgentsService"],["com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsOperationsClientImpl$GuestAgentsOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.HybridIdentityMetadatasClientImpl$HybridIdentityMetadatasService"],["com.azure.resourcemanager.azurestackhci.implementation.LogicalNetworksOperationsClientImpl$LogicalNetworksOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.MarketplaceGalleryImagesOperationsClientImpl$MarketplaceGalleryImagesOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.NetworkInterfacesOperationsClientImpl$NetworkInterfacesOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.OffersClientImpl$OffersService"],["com.azure.resourcemanager.azurestackhci.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.PublishersClientImpl$PublishersService"],["com.azure.resourcemanager.azurestackhci.implementation.SecuritySettingsClientImpl$SecuritySettingsService"],["com.azure.resourcemanager.azurestackhci.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.azurestackhci.implementation.StorageContainersOperationsClientImpl$StorageContainersOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsClientImpl$UpdateRunsService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsClientImpl$UpdateSummariesOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.UpdatesClientImpl$UpdatesService"],["com.azure.resourcemanager.azurestackhci.implementation.VirtualHardDisksOperationsClientImpl$VirtualHardDisksOperationsService"],["com.azure.resourcemanager.azurestackhci.implementation.VirtualMachineInstancesClientImpl$VirtualMachineInstancesService"]] \ No newline at end of file diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.java index c87e2a027025..863a3b25ceb7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.java @@ -10,16 +10,16 @@ public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ConsentAndInstallDefaultExtensions.json */ /** * Sample code: Consent And Install Default Extensions. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - consentAndInstallDefaultExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + consentAndInstallDefaultExtensions(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .consentAndInstallDefaultExtensionsWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); 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 index 6686faa90d53..f239ba98c028 100644 --- 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 @@ -10,15 +10,15 @@ public final class ArcSettingsCreateIdentitySamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateArcIdentity.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateArcIdentity + * .json */ /** * Sample code: Create Arc Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().createIdentity("test-rg", "myCluster", "default", com.azure.core.util.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 index 2c6a0bd313da..9b88a5029d2a 100644 --- 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 @@ -10,15 +10,15 @@ public final class ArcSettingsCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutArcSetting. + * json */ /** * Sample code: Create ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + 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 index 7772f1c1e774..14c45fb5de7b 100644 --- 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 @@ -10,15 +10,15 @@ public final class ArcSettingsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteArcSetting. + * json */ /** * Sample code: Delete ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.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 index 36edb646d053..18408e5751a1 100644 --- 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 @@ -10,15 +10,15 @@ public final class ArcSettingsGeneratePasswordSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GeneratePassword.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GeneratePassword. + * json */ /** * Sample code: Generate Password. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .generatePasswordWithResponse("test-rg", "myCluster", "default", com.azure.core.util.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 index 029f83340470..ad0293834a13 100644 --- 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 @@ -10,15 +10,15 @@ public final class ArcSettingsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetArcSetting. + * json */ /** * Sample code: Get ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.java index 332f459b04fe..8a22f2f4f5ef 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.java @@ -10,15 +10,15 @@ public final class ArcSettingsInitializeDisableProcessSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * InitializeDisableProcess.json */ /** * Sample code: Trigger ARC Disable. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings() .initializeDisableProcess("test-rg", "myCluster", "default", 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/ArcSettingsListByClusterSamples.java index f4ba17db6480..628bc51ff260 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/ArcSettingsListByClusterSamples.java @@ -10,16 +10,16 @@ public final class ArcSettingsListByClusterSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listArcSettingResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listArcSettingResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.arcSettings().listByCluster("test-rg", "myCluster", com.azure.core.util.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 index 380a93c2f1f1..170227fce552 100644 --- 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 @@ -15,15 +15,15 @@ public final class ArcSettingsUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PatchArcSetting.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchArcSetting. + * json */ /** * Sample code: Patch ArcSetting. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { ArcSetting resource = manager.arcSettings() .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportSamples.java deleted file mode 100644 index 0358899aee9b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportType; -import java.time.OffsetDateTime; - -/** - * Samples for Clusters ConfigureRemoteSupport. - */ -public final class ClustersConfigureRemoteSupportSamples { - /* - * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ConfigureRemoteSupport.json - */ - /** - * Sample code: Configure Remote Support. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void configureRemoteSupport(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters() - .configureRemoteSupport("test-rg", "mycluster", - new RemoteSupportRequest().withProperties(new RemoteSupportRequestProperties() - .withExpirationTimestamp(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withRemoteSupportType(RemoteSupportType.ENABLE)), - com.azure.core.util.Context.NONE); - } -} 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/ClustersCreateIdentitySamples.java index bcdeaa47aeda..42483f5268c9 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/ClustersCreateIdentitySamples.java @@ -10,15 +10,15 @@ public final class ClustersCreateIdentitySamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().createIdentity("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } 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 index 4c2104fefec8..d4b36f28d946 100644 --- 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 @@ -12,15 +12,15 @@ public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateCluster. + * json */ /** * Sample code: Create cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .define("myCluster") .withRegion("East US") 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 index f21c897c3d3d..5bd6e1422071 100644 --- 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 @@ -10,15 +10,15 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteCluster. + * json */ /** * Sample code: Delete cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().delete("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java index b10f298dd248..a9a42243eec3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java @@ -14,15 +14,15 @@ public final class ClustersExtendSoftwareAssuranceBenefitSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ExtendSoftwareAssuranceBenefit.json */ /** * Sample code: Create cluster Identity. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .extendSoftwareAssuranceBenefit("test-rg", "myCluster", new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() 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 index c881309e4b06..35b6f45a87bb 100644 --- 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 @@ -10,15 +10,14 @@ public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetCluster.json */ /** * Sample code: Get cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", 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/ClustersListByResourceGroupSamples.java index d963e11228d4..1d11eb5f38a0 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/ClustersListByResourceGroupSamples.java @@ -10,16 +10,16 @@ public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listClustersInAGivenResourceGroup(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listClustersInAGivenResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().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/ClustersListSamples.java index cc5873016893..ffe76aed21ce 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/ClustersListSamples.java @@ -10,16 +10,16 @@ public final class ClustersListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listClustersInAGivenSubscription(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listClustersInAGivenSubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionSamples.java deleted file mode 100644 index ec8047429825..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionSamples.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.resourcemanager.azurestackhci.models.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequestProperties; -import java.time.OffsetDateTime; - -/** - * Samples for Clusters TriggerLogCollection. - */ -public final class ClustersTriggerLogCollectionSamples { - /* - * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * TriggerLogCollection.json - */ - /** - * Sample code: Trigger Log Collection. - * - * @param manager Entry point to AzureStackHciManager. - */ - public static void triggerLogCollection(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters() - .triggerLogCollection("test-rg", "mycluster", - new LogCollectionRequest().withProperties(new LogCollectionRequestProperties() - .withFromDate(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withToDate(OffsetDateTime.parse("2021-01-01T17:18:19.1234567Z"))), - com.azure.core.util.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 index 80c9c6d1812c..6b1954c612b9 100644 --- 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 @@ -18,15 +18,15 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * UpdateCluster.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateCluster. + * json */ /** * Sample code: Update cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { Cluster resource = manager.clusters() .getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE) .getValue(); 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 index c2b5c71eed12..87ffb5291942 100644 --- 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 @@ -14,15 +14,15 @@ public final class ClustersUploadCertificateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * UploadCertificate.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UploadCertificate + * .json */ /** * Sample code: Upload certificate. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.clusters() .uploadCertificate("test-rg", "myCluster", new UploadCertificateRequest().withProperties( diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateSamples.java index 398fd1274543..ef44b76511f5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateSamples.java @@ -4,35 +4,24 @@ package com.azure.resourcemanager.azurestackhci.generated; +import com.azure.resourcemanager.azurestackhci.models.AdapterPropertyOverrides; import com.azure.resourcemanager.azurestackhci.models.DeploymentCluster; import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration; import com.azure.resourcemanager.azurestackhci.models.DeploymentData; import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; import com.azure.resourcemanager.azurestackhci.models.DeploymentSecuritySettings; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingHostNetwork; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingIntents; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageAdapterIpInfo; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageNetworks; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides; -import com.azure.resourcemanager.azurestackhci.models.EceDeploymentSecrets; -import com.azure.resourcemanager.azurestackhci.models.EceSecrets; +import com.azure.resourcemanager.azurestackhci.models.HostNetwork; import com.azure.resourcemanager.azurestackhci.models.InfrastructureNetwork; +import com.azure.resourcemanager.azurestackhci.models.Intents; import com.azure.resourcemanager.azurestackhci.models.IpPools; -import com.azure.resourcemanager.azurestackhci.models.NetworkController; import com.azure.resourcemanager.azurestackhci.models.Observability; -import com.azure.resourcemanager.azurestackhci.models.OperationType; import com.azure.resourcemanager.azurestackhci.models.OptionalServices; import com.azure.resourcemanager.azurestackhci.models.PhysicalNodes; import com.azure.resourcemanager.azurestackhci.models.QosPolicyOverrides; -import com.azure.resourcemanager.azurestackhci.models.SbeCredentials; -import com.azure.resourcemanager.azurestackhci.models.SbeDeploymentInfo; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerInfo; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerProperties; import com.azure.resourcemanager.azurestackhci.models.ScaleUnits; -import com.azure.resourcemanager.azurestackhci.models.SdnIntegration; import com.azure.resourcemanager.azurestackhci.models.Storage; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.azurestackhci.models.StorageNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualSwitchConfigurationOverrides; import java.util.Arrays; /** @@ -41,15 +30,15 @@ public final class DeploymentSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * PutDeploymentSettings.json */ /** * Sample code: Create Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings() .define("default") .withExistingCluster("test-rg", "myCluster") @@ -57,97 +46,60 @@ public static void createDeploymentSettings(com.azure.resourcemanager.azurestack "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2")) .withDeploymentMode(DeploymentMode.DEPLOY) - .withOperationType(OperationType.CLUSTER_PROVISIONING) - .withDeploymentConfiguration( - new DeploymentConfiguration().withVersion("string") - .withScaleUnits(Arrays.asList(new ScaleUnits() - .withDeploymentData(new DeploymentData() - .withSecuritySettings(new DeploymentSecuritySettings().withHvciProtection(true) - .withDrtmProtection(true) - .withDriftControlEnforced(true) - .withCredentialGuardEnforced(false) - .withSmbSigningEnforced(true) - .withSmbClusterEncryption(false) - .withSideChannelMitigationEnforced(true) - .withBitlockerBootVolume(true) - .withBitlockerDataVolumes(true) - .withWdacEnforced(true)) - .withObservability(new Observability().withStreamingDataClient(true) - .withEuLocation(false) - .withEpisodicDataUpload(true)) - .withCluster(new DeploymentCluster().withName("testHCICluster") - .withWitnessType("Cloud") - .withWitnessPath("Cloud") - .withCloudAccountName("myasestoragacct") - .withAzureServiceEndpoint("core.windows.net")) - .withStorage(new Storage().withConfigurationMode("Express")) - .withNamingPrefix("ms169") - .withDomainFqdn("ASZ1PLab8.nttest.microsoft.com") - .withInfrastructureNetwork(Arrays.asList(new InfrastructureNetwork() - .withSubnetMask("255.255.248.0") - .withGateway("255.255.248.0") - .withIpPools(Arrays.asList( - new IpPools().withStartingAddress("10.57.48.60").withEndingAddress("10.57.48.66"))) - .withDnsServers(Arrays.asList("10.57.50.90")))) - .withPhysicalNodes(Arrays.asList( - new PhysicalNodes().withName("ms169host").withIpv4Address("10.57.51.224"), - new PhysicalNodes().withName("ms154host").withIpv4Address("10.57.53.236"))) - .withHostNetwork(new DeploymentSettingHostNetwork() - .withIntents(Arrays.asList(new DeploymentSettingIntents().withName("Compute_Management") - .withTrafficType(Arrays.asList("Compute", "Management")) - .withAdapter(Arrays.asList("Port2")) - .withOverrideVirtualSwitchConfiguration(false) - .withVirtualSwitchConfigurationOverrides( - new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("True") - .withLoadBalancingAlgorithm("HyperVPort")) - .withOverrideQosPolicy(false) - .withQosPolicyOverrides( - new QosPolicyOverrides().withPriorityValue8021ActionCluster("7") - .withPriorityValue8021ActionSmb("3") - .withBandwidthPercentageSmb("50")) - .withOverrideAdapterProperty(false) - .withAdapterPropertyOverrides( - new DeploymentSettingAdapterPropertyOverrides().withJumboPacket("1514") - .withNetworkDirect("Enabled") - .withNetworkDirectTechnology("iWARP")))) - .withStorageNetworks( - Arrays.asList(new DeploymentSettingStorageNetworks().withName("Storage1Network") - .withNetworkAdapterName("Port3") - .withVlanId("5") - .withStorageAdapterIpInfo(Arrays.asList( - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("string") - .withIpv4Address("10.57.48.60") - .withSubnetMask("255.255.248.0"))))) - .withStorageConnectivitySwitchless(true) - .withEnableStorageAutoIp(false)) - .withSdnIntegration(new SdnIntegration().withNetworkController( - new NetworkController().withMacAddressPoolStart("00-0D-3A-1B-C7-21") - .withMacAddressPoolStop("00-0D-3A-1B-C7-29") - .withNetworkVirtualizationEnabled(true))) - .withAdouPath("OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com") - .withSecretsLocation("fakeTokenPlaceholder") - .withSecrets(Arrays.asList( - new EceDeploymentSecrets().withSecretName("fakeTokenPlaceholder") - .withEceSecretName(EceSecrets.fromString("BMCAdminUserCred")) - .withSecretLocation("fakeTokenPlaceholder"), - new EceDeploymentSecrets().withSecretName("fakeTokenPlaceholder") - .withEceSecretName(EceSecrets.AZURE_STACK_LCMUSER_CREDENTIAL) - .withSecretLocation("fakeTokenPlaceholder"))) - .withOptionalServices(new OptionalServices().withCustomLocation("customLocationName"))) - .withSbePartnerInfo(new SbePartnerInfo() - .withSbeDeploymentInfo(new SbeDeploymentInfo().withVersion("4.0.2309.13") - .withFamily("Gen5") - .withPublisher("Contoso") - .withSbeManifestSource("default") - .withSbeManifestCreationDate(OffsetDateTime.parse("2023-07-25T02:40:33Z"))) - .withPartnerProperties( - Arrays.asList(new SbePartnerProperties().withName("EnableBMCIpV6").withValue("false"), - new SbePartnerProperties().withName("PhoneHomePort").withValue("1653"), - new SbePartnerProperties().withName("BMCSecurityState").withValue("HighSecurity"))) - .withCredentialList( - Arrays.asList(new SbeCredentials().withSecretName("fakeTokenPlaceholder") - .withEceSecretName("fakeTokenPlaceholder") - .withSecretLocation("fakeTokenPlaceholder"))))))) + .withDeploymentConfiguration(new DeploymentConfiguration().withVersion("string") + .withScaleUnits(Arrays.asList(new ScaleUnits().withDeploymentData(new DeploymentData() + .withSecuritySettings(new DeploymentSecuritySettings().withHvciProtection(true) + .withDrtmProtection(true) + .withDriftControlEnforced(true) + .withCredentialGuardEnforced(false) + .withSmbSigningEnforced(true) + .withSmbClusterEncryption(false) + .withSideChannelMitigationEnforced(true) + .withBitlockerBootVolume(true) + .withBitlockerDataVolumes(true) + .withWdacEnforced(true)) + .withObservability(new Observability().withStreamingDataClient(true) + .withEuLocation(false) + .withEpisodicDataUpload(true)) + .withCluster(new DeploymentCluster().withName("testHCICluster") + .withWitnessType("Cloud") + .withWitnessPath("Cloud") + .withCloudAccountName("myasestoragacct") + .withAzureServiceEndpoint("core.windows.net")) + .withStorage(new Storage().withConfigurationMode("Express")) + .withNamingPrefix("ms169") + .withDomainFqdn("ASZ1PLab8.nttest.microsoft.com") + .withInfrastructureNetwork(Arrays.asList(new InfrastructureNetwork().withSubnetMask("255.255.248.0") + .withGateway("255.255.248.0") + .withIpPools(Arrays + .asList(new IpPools().withStartingAddress("10.57.48.60").withEndingAddress("10.57.48.66"))) + .withDnsServers(Arrays.asList("10.57.50.90")))) + .withPhysicalNodes( + Arrays.asList(new PhysicalNodes().withName("ms169host").withIpv4Address("10.57.51.224"), + new PhysicalNodes().withName("ms154host").withIpv4Address("10.57.53.236"))) + .withHostNetwork(new HostNetwork() + .withIntents(Arrays.asList(new Intents().withName("Compute_Management") + .withTrafficType(Arrays.asList("Compute", "Management")) + .withAdapter(Arrays.asList("Port2")) + .withOverrideVirtualSwitchConfiguration(false) + .withVirtualSwitchConfigurationOverrides( + new VirtualSwitchConfigurationOverrides().withEnableIov("True") + .withLoadBalancingAlgorithm("HyperVPort")) + .withOverrideQosPolicy(false) + .withQosPolicyOverrides(new QosPolicyOverrides().withPriorityValue8021ActionCluster("7") + .withPriorityValue8021ActionSmb("3") + .withBandwidthPercentageSmb("50")) + .withOverrideAdapterProperty(false) + .withAdapterPropertyOverrides(new AdapterPropertyOverrides().withJumboPacket("1514") + .withNetworkDirect("Enabled") + .withNetworkDirectTechnology("iWARP")))) + .withStorageNetworks(Arrays.asList(new StorageNetworks().withName("Storage1Network") + .withNetworkAdapterName("Port3") + .withVlanId("5"))) + .withStorageConnectivitySwitchless(true)) + .withAdouPath("OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com") + .withSecretsLocation("fakeTokenPlaceholder") + .withOptionalServices(new OptionalServices().withCustomLocation("customLocationName")))))) .create(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsDeleteSamples.java index 7ef8924f3ff2..628916219a57 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsDeleteSamples.java @@ -10,15 +10,15 @@ public final class DeploymentSettingsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * DeleteDeploymentSettings.json */ /** * Sample code: Delete Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetSamples.java index 3483f165bd45..36a0fca2dd37 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetSamples.java @@ -10,15 +10,15 @@ public final class DeploymentSettingsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * GetDeploymentSettings.json */ /** * Sample code: Get Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings() .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersSamples.java index 9a89ace98805..77b890111a43 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersSamples.java @@ -10,15 +10,15 @@ public final class DeploymentSettingsListByClustersSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListDeploymentSettingsByCluster.json */ /** * Sample code: List Deployment Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.deploymentSettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateSamples.java index 241fea74699b..204834e9e67b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateSamples.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.azurestackhci.generated; import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDevice; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceProperties; import com.azure.resourcemanager.azurestackhci.models.NicDetail; import java.util.Arrays; @@ -16,29 +14,29 @@ public final class EdgeDevicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * CreateHciEdgeDevice.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutEdgeDevices. + * json */ /** - * Sample code: Create HCI Edge Device. + * Sample code: Create Edge Device. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createHCIEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createEdgeDevice(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() - .createOrUpdate( - "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", - "default", - new HciEdgeDevice().withProperties(new HciEdgeDeviceProperties().withDeviceConfiguration( - new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("ethernet") - .withInterfaceDescription("NDIS 6.70 ") - .withComponentId("VMBUS{f8615163-df3e-46c5-913f-f2d2f965ed0g} ") - .withDriverVersion("10.0.20348.1547 ") - .withIp4Address("10.10.10.10") - .withSubnetMask("255.255.255.0") - .withDefaultGateway("10.10.10.1") - .withDnsServers(Arrays.asList("100.10.10.1")) - .withDefaultIsolationId("0"))).withDeviceMetadata(""))), - com.azure.core.util.Context.NONE); + .define("default") + .withExistingResourceUri( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1") + .withDeviceConfiguration( + new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("ethernet") + .withInterfaceDescription("NDIS 6.70 ") + .withComponentId("VMBUS{f8615163-df3e-46c5-913f-f2d2f965ed0g} ") + .withDriverVersion("10.0.20348.1547 ") + .withIp4Address("10.10.10.10") + .withSubnetMask("255.255.255.0") + .withDefaultGateway("10.10.10.1") + .withDnsServers(Arrays.asList("100.10.10.1")) + .withDefaultIsolationId("0"))).withDeviceMetadata("")) + .create(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesDeleteSamples.java index f1abc8460fc2..931abdbedc9e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesDeleteSamples.java @@ -10,15 +10,15 @@ public final class EdgeDevicesDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteEdgeDevices + * .json */ /** * Sample code: Delete Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .delete( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetSamples.java index 5a65f638b641..b275c811443a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetSamples.java @@ -10,15 +10,15 @@ public final class EdgeDevicesGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetEdgeDevices. + * json */ /** * Sample code: Get Edge Device. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getEdgeDevice(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .getWithResponse( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListSamples.java index 15286729e118..e8884112a4b6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListSamples.java @@ -10,15 +10,15 @@ public final class EdgeDevicesListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListEdgeDevices.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListEdgeDevices. + * json */ /** * Sample code: List Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .list( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateSamples.java index 11997ce1c5e8..5e6d72984e44 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateSamples.java @@ -13,15 +13,15 @@ public final class EdgeDevicesValidateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ValidateEdgeDevices.json */ /** * Sample code: Validate Edge Devices. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void validateEdgeDevices(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void validateEdgeDevices(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.edgeDevices() .validate( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", 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 index 6ab09cf4ceaf..04c492b1b0a5 100644 --- 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 @@ -14,15 +14,14 @@ public final class ExtensionsCreateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { manager.extensions() .define("MicrosoftMonitoringAgent") 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/ExtensionsDeleteSamples.java index e98ced62c35a..acfd6fce0ffa 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/ExtensionsDeleteSamples.java @@ -10,15 +10,15 @@ public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteExtension. + * json */ /** * Sample code: Delete Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } 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 index 7361a356a82c..c23162cae2ba 100644 --- 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 @@ -10,15 +10,14 @@ public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", 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/ExtensionsListByArcSettingSamples.java index b49dc1ec0cab..df697f416137 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/ExtensionsListByArcSettingSamples.java @@ -10,16 +10,16 @@ public final class ExtensionsListByArcSettingSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listExtensionsUnderArcSettingResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listExtensionsUnderArcSettingResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions().listByArcSetting("test-rg", "myCluster", "default", com.azure.core.util.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 index b08dd5961256..e3c11fb07101 100644 --- 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 @@ -16,15 +16,15 @@ public final class ExtensionsUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PatchExtension.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchExtension. + * json */ /** * Sample code: Update Arc Extension. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) throws IOException { Extension resource = manager.extensions() .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java index fcac1c97189d..2bbe7992fe44 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java @@ -12,15 +12,15 @@ public final class ExtensionsUpgradeSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * Extensions_Upgrade.json */ /** * Sample code: Upgrade Machine Extensions. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.extensions() .upgrade("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", new ExtensionUpgradeParameters().withTargetVersion("1.0.18062.0"), com.azure.core.util.Context.NONE); 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 000000000000..5400e809c670 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationCreateOrUpdateSamples.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.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/stable/2024-01-01/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( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-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/GalleryImagesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationDeleteSamples.java new file mode 100644 index 000000000000..56908a0286aa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationDeleteSamples.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 GalleryImagesOperation Delete. + */ +public final class GalleryImagesOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} 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 000000000000..62e08ecddfcd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationGetByResourceGroupSamples.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 GalleryImagesOperation GetByResourceGroup. + */ +public final class GalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..b4e78d1e4ee9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListByResourceGroupSamples.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 GalleryImagesOperation ListByResourceGroup. + */ +public final class GalleryImagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/GalleryImagesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListSamples.java new file mode 100644 index 000000000000..31a9e9aae0c6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationListSamples.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 GalleryImagesOperation List. + */ +public final class GalleryImagesOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} 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 000000000000..3dca19e70ac4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesOperationUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 000000000000..b0427ff35e06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentCreateSamples.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.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/stable/2024-01-01/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 000000000000..05bcd4c9a39a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for GuestAgent Delete. + */ +public final class GuestAgentDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..c8573ee6e30d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for GuestAgent Get. + */ +public final class GuestAgentGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..81a9ac3da0fd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentsOperationListSamples.java @@ -0,0 +1,28 @@ +// Copyright (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/stable/2024-01-01/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 000000000000..780c5b7bc296 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for HybridIdentityMetadata Get. + */ +public final class HybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..8f88665165f3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/HybridIdentityMetadataListSamples.java @@ -0,0 +1,28 @@ +// Copyright (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/stable/2024-01-01/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/LogicalNetworksOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..29c6d6796fc7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationCreateOrUpdateSamples.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 LogicalNetworksOperation CreateOrUpdate. + */ +public final class LogicalNetworksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutLogicalNetwork + * .json + */ + /** + * Sample code: PutLogicalNetwork. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void putLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations() + .define("test-lnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationDeleteSamples.java new file mode 100644 index 000000000000..ce575749c723 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationDeleteSamples.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 LogicalNetworksOperation Delete. + */ +public final class LogicalNetworksOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteLogicalNetwork.json + */ + /** + * Sample code: DeleteLogicalNetwork. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void deleteLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().delete("test-rg", "test-lnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationGetByResourceGroupSamples.java new file mode 100644 index 000000000000..97a34586291d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationGetByResourceGroupSamples.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 LogicalNetworksOperation GetByResourceGroup. + */ +public final class LogicalNetworksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetLogicalNetwork + * .json + */ + /** + * Sample code: GetLogicalNetwork. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void getLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-lnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationListByResourceGroupSamples.java new file mode 100644 index 000000000000..9eb4c25234ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationListByResourceGroupSamples.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 LogicalNetworksOperation ListByResourceGroup. + */ +public final class LogicalNetworksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListLogicalNetworkByResourceGroup.json + */ + /** + * Sample code: ListLogicalNetworkByResourceGroup. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listLogicalNetworkByResourceGroup(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().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/LogicalNetworksOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationListSamples.java new file mode 100644 index 000000000000..eb8f21749b8b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationListSamples.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 LogicalNetworksOperation List. + */ +public final class LogicalNetworksOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListLogicalNetworkBySubscription.json + */ + /** + * Sample code: ListLogicalNetworkBySubscription. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listLogicalNetworkBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + manager.logicalNetworksOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationUpdateSamples.java new file mode 100644 index 000000000000..11ce937860b5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksOperationUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (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.LogicalNetworks; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogicalNetworksOperation Update. + */ +public final class LogicalNetworksOperationUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * UpdateLogicalNetwork.json + */ + /** + * Sample code: UpdateLogicalNetwork. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void updateLogicalNetwork(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + LogicalNetworks resource = manager.logicalNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-lnet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 000000000000..71cd57ad4c8c --- /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/stable/2024-01-01/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( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-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 000000000000..789a7f1b3bc2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (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/stable/2024-01-01/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 000000000000..fe9c37f5790a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. + */ +public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..df8db0eff9e5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListByResourceGroupSamples.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 MarketplaceGalleryImagesOperation ListByResourceGroup. + */ +public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..5847045e4052 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationListSamples.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 MarketplaceGalleryImagesOperation List. + */ +public final class MarketplaceGalleryImagesOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..9ccc8b415153 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesOperationUpdateSamples.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.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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 000000000000..482691625f6a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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/stable/2024-01-01/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-lnet"))))) + .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 000000000000..ec317e569388 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationDeleteSamples.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 NetworkInterfacesOperation Delete. + */ +public final class NetworkInterfacesOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..444566d7f125 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationGetByResourceGroupSamples.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 NetworkInterfacesOperation GetByResourceGroup. + */ +public final class NetworkInterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..9d6763c2d4a6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListByResourceGroupSamples.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 NetworkInterfacesOperation ListByResourceGroup. + */ +public final class NetworkInterfacesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/NetworkInterfacesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListSamples.java new file mode 100644 index 000000000000..1434a8e007f5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationListSamples.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 NetworkInterfacesOperation List. + */ +public final class NetworkInterfacesOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListNetworkInterfaceBySubscription.json + */ + /** + * Sample code: ListNetworkInterfaceBySubscription. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listNetworkInterfaceBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + 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 000000000000..2ea80d1a61de --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesOperationUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java index 0fd9d6a2eab8..194a9a2acdb3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java @@ -10,15 +10,14 @@ public final class OffersGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetOffer - * .json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetOffer.json */ /** * Sample code: Get Offer. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.offers() .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java index dc4034c9588f..ab6830120e3e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java @@ -10,16 +10,16 @@ public final class OffersListByClusterSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListOffersByCluster.json */ /** * Sample code: List Offer resources by HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listOfferResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listOfferResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.offers().listByCluster("test-rg", "myCluster", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java index b08c377e749f..ab87586114d1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java @@ -10,16 +10,16 @@ public final class OffersListByPublisherSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListOffersByPublisher.json */ /** * Sample code: List Offer resources by publisher for the HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void listOfferResourcesByPublisherForTheHCICluster( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, com.azure.core.util.Context.NONE); } } 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 index ba8fb1697876..761f4d11a451 100644 --- 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 @@ -10,15 +10,15 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/operations/stable/2024-04-01/examples/ - * ListOperations.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListOperations. + * json */ /** * Sample code: Create cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.operations().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java index 306ec2b57114..97c895a92060 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java @@ -10,15 +10,14 @@ public final class PublishersGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetPublisher.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetPublisher.json */ /** * Sample code: Get Publisher. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java index 27fc038234a4..4fe0f4a7edd8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java @@ -10,16 +10,16 @@ public final class PublishersListByClusterSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListPublishersByCluster.json */ /** * Sample code: List Publisher resources by HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listPublisherResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listPublisherResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.publishers().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateSamples.java index 9870224aac9b..a9ac7414a5e5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateSamples.java @@ -12,21 +12,19 @@ public final class SecuritySettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * PutSecuritySettings.json */ /** * Sample code: Create Security Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void createSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.securitySettings() .define("default") .withExistingCluster("test-rg", "myCluster") .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) .create(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsDeleteSamples.java index 0700c538e989..4e55dd18e720 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsDeleteSamples.java @@ -10,15 +10,15 @@ public final class SecuritySettingsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * DeleteSecuritySettings.json */ /** * Sample code: Delete Security Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.securitySettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetSamples.java index c1c85dc9d12a..545b7f8889bf 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetSamples.java @@ -10,15 +10,15 @@ public final class SecuritySettingsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * GetSecuritySettings.json */ /** * Sample code: Get Security Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.securitySettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersSamples.java index 1e2ca2f86fbd..0651e0e394b2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersSamples.java @@ -10,15 +10,15 @@ public final class SecuritySettingsListByClustersSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListSecuritySettingsByCluster.json */ /** * Sample code: List Security Settings. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listSecuritySettings(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.securitySettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java index f043e77780e2..adf7017247d7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java @@ -10,15 +10,14 @@ public final class SkusGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSku. - * json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetSku.json */ /** * Sample code: Get Sku. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getSku(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.skus() .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", "sku1", null, com.azure.core.util.Context.NONE); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java index 2a4381f0b17a..941403015e2e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java @@ -10,16 +10,16 @@ public final class SkusListByOfferSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListSkusByOffer.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListSkusByOffer. + * json */ /** * Sample code: List SKU resources by offer for the HCI Cluster. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listSKUResourcesByOfferForTheHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listSKUResourcesByOfferForTheHCICluster(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.skus() .listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.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 000000000000..6ab0c7015360 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationCreateOrUpdateSamples.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; + +/** + * Samples for StorageContainersOperation CreateOrUpdate. + */ +public final class StorageContainersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..b474dba058d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationDeleteSamples.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 StorageContainersOperation Delete. + */ +public final class StorageContainersOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..2b1cd5022d88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationGetByResourceGroupSamples.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 StorageContainersOperation GetByResourceGroup. + */ +public final class StorageContainersOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..4b418dd53808 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListByResourceGroupSamples.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 StorageContainersOperation ListByResourceGroup. + */ +public final class StorageContainersOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/StorageContainersOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListSamples.java new file mode 100644 index 000000000000..c755da00e115 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationListSamples.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 StorageContainersOperation List. + */ +public final class StorageContainersOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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); + } +} 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 000000000000..13a2c4032c28 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersOperationUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java index 112d468c8567..6ccd062aa58a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java @@ -10,15 +10,15 @@ public final class UpdateRunsDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdateRuns. + * json */ /** * Sample code: Delete an Update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateRuns() .delete("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", com.azure.core.util.Context.NONE); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java index d6719c2227be..c41d7cb423db 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java @@ -10,16 +10,16 @@ public final class UpdateRunsGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdateRuns. + * json */ /** * Sample code: Get Update runs under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateRuns() .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", com.azure.core.util.Context.NONE); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java index 6b51f16e9a6c..6043b8cc6a22 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java @@ -10,16 +10,16 @@ public final class UpdateRunsListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdateRuns. + * json */ /** * Sample code: List Update runs under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - listUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + listUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java index a679d1ba1e50..12cd77b9c898 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java @@ -15,16 +15,16 @@ public final class UpdateRunsPutSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutUpdateRuns.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdateRuns. + * json */ /** * Sample code: Get Update runs under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + getUpdateRunsUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { UpdateRun resource = manager.updateRuns() .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", com.azure.core.util.Context.NONE) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java index 5005dcc257c1..2e2c356d75e4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java @@ -10,15 +10,15 @@ public final class UpdateSummariesOperationDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * DeleteUpdateSummaries.json */ /** * Sample code: Delete an Update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java index 73d520236136..b666a7c38876 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java @@ -10,16 +10,16 @@ public final class UpdateSummariesOperationGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * GetUpdateSummaries.json */ /** * Sample code: Get Update summaries under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java index d83a60452872..c11075fb6079 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java @@ -10,16 +10,16 @@ public final class UpdateSummariesOperationListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * ListUpdateSummaries.json */ /** * Sample code: Get Update summaries under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java index 291b837183e4..ed06c8802892 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java @@ -14,16 +14,16 @@ public final class UpdateSummariesOperationPutSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ * PutUpdateSummaries.json */ /** * Sample code: Put Update summaries under cluster resource. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ public static void - putUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + putUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updateSummariesOperations() .putWithResponse("testrg", "testcluster", new UpdateSummariesInner().withOemFamily("DellEMC") diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java index 9138aa5546fa..72c0d548d54d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java @@ -10,15 +10,15 @@ public final class UpdatesDeleteSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * DeleteUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdates. + * json */ /** * Sample code: Delete an Update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java index 04a56ba67409..17a061450fed 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java @@ -10,15 +10,14 @@ public final class UpdatesGetSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * GetUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdates.json */ /** * Sample code: Get a specific update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updates() .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java index d8724f54bbf7..349bdf32deb1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java @@ -10,15 +10,14 @@ public final class UpdatesListSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * ListUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdates.json */ /** * Sample code: List available updates. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java index 586f3f372bb0..4d3684f5626a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java @@ -10,15 +10,14 @@ public final class UpdatesPostSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PostUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PostUpdates.json */ /** * Sample code: List available updates. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java index c27f4dc2ba57..b7ee7cd3444c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java @@ -17,15 +17,14 @@ public final class UpdatesPutSamples { /* * x-ms-original-file: - * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ - * PutUpdates.json + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdates.json */ /** * Sample code: Put a specific update. * - * @param manager Entry point to AzureStackHciManager. + * @param manager Entry point to AzurestackhciManager. */ - public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { HciUpdate resource = manager.updates() .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE) .getValue(); 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 000000000000..6ff72302c8b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationCreateOrUpdateSamples.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; + +/** + * Samples for VirtualHardDisksOperation CreateOrUpdate. + */ +public final class VirtualHardDisksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/VirtualHardDisksOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationDeleteSamples.java new file mode 100644 index 000000000000..34c5b10dc136 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationDeleteSamples.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 VirtualHardDisksOperation Delete. + */ +public final class VirtualHardDisksOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteVirtualHardDisk.json + */ + /** + * Sample code: DeleteVirtualHardDisk. + * + * @param manager Entry point to AzurestackhciManager. + */ + 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 000000000000..138de0f20215 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationGetByResourceGroupSamples.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 VirtualHardDisksOperation GetByResourceGroup. + */ +public final class VirtualHardDisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..8754c871c635 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListByResourceGroupSamples.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 VirtualHardDisksOperation ListByResourceGroup. + */ +public final class VirtualHardDisksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/VirtualHardDisksOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListSamples.java new file mode 100644 index 000000000000..d840bbe58cb5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationListSamples.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 VirtualHardDisksOperation List. + */ +public final class VirtualHardDisksOperationListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListVirtualHardDiskBySubscription.json + */ + /** + * Sample code: ListVirtualHardDiskBySubscription. + * + * @param manager Entry point to AzurestackhciManager. + */ + public static void + listVirtualHardDiskBySubscription(com.azure.resourcemanager.azurestackhci.AzurestackhciManager manager) { + 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 000000000000..c4eca55eba28 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksOperationUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (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/stable/2024-01-01/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(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 000000000000..6ef797c62e95 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesCreateOrUpdateSamples.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.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/stable/2024-01-01/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/stable/2024-01-01/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/stable/2024-01-01/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/stable/2024-01-01/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 000000000000..d9fc8e7f4508 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for VirtualMachineInstances Delete. + */ +public final class VirtualMachineInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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", + 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 000000000000..e5311596c7cc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for VirtualMachineInstances Get. + */ +public final class VirtualMachineInstancesGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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 000000000000..29d00dd0c49b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesListSamples.java @@ -0,0 +1,28 @@ +// Copyright (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/stable/2024-01-01/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 000000000000..6605d60b6fec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesRestartSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for VirtualMachineInstances Restart. + */ +public final class VirtualMachineInstancesRestartSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/default", + 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 000000000000..5f376862ba71 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStartSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for VirtualMachineInstances Start. + */ +public final class VirtualMachineInstancesStartSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/default", + 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 000000000000..9a0215ceceee --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesStopSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for VirtualMachineInstances Stop. + */ +public final class VirtualMachineInstancesStopSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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/default", + 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 000000000000..79c596efe7fb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancesUpdateSamples.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.StorageProfileUpdate; +import com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdateDataDisksItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateProperties; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; +import java.util.Arrays; + +/** + * Samples for VirtualMachineInstances Update. + */ +public final class VirtualMachineInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/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().withStorageProfile(new StorageProfileUpdate() + .withDataDisks(Arrays.asList(new StorageProfileUpdateDataDisksItem().withId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponseInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponseInnerTests.java deleted file mode 100644 index e674b3e3168d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponseInnerTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; - -public final class ArcIdentityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcIdentityResponseInner model = BinaryData.fromString( - "{\"properties\":{\"arcApplicationClientId\":\"fouflmmnkzsmo\",\"arcApplicationTenantId\":\"glougpbk\",\"arcServicePrincipalObjectId\":\"mutduqktaps\",\"arcApplicationObjectId\":\"gcue\"}}") - .toObject(ArcIdentityResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcIdentityResponseInner model = new ArcIdentityResponseInner(); - model = BinaryData.fromObject(model).toObject(ArcIdentityResponseInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponsePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponsePropertiesTests.java deleted file mode 100644 index f913d16bf394..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcIdentityResponsePropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class ArcIdentityResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcIdentityResponseProperties model = BinaryData.fromString( - "{\"arcApplicationClientId\":\"umkdosvqwhbmd\",\"arcApplicationTenantId\":\"bjf\",\"arcServicePrincipalObjectId\":\"gmbmbexppbh\",\"arcApplicationObjectId\":\"qrolfpf\"}") - .toObject(ArcIdentityResponseProperties.class); - Assertions.assertEquals("umkdosvqwhbmd", model.arcApplicationClientId()); - Assertions.assertEquals("bjf", model.arcApplicationTenantId()); - Assertions.assertEquals("gmbmbexppbh", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("qrolfpf", model.arcApplicationObjectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcIdentityResponseProperties model - = new ArcIdentityResponseProperties().withArcApplicationClientId("umkdosvqwhbmd") - .withArcApplicationTenantId("bjf") - .withArcServicePrincipalObjectId("gmbmbexppbh") - .withArcApplicationObjectId("qrolfpf"); - model = BinaryData.fromObject(model).toObject(ArcIdentityResponseProperties.class); - Assertions.assertEquals("umkdosvqwhbmd", model.arcApplicationClientId()); - Assertions.assertEquals("bjf", model.arcApplicationTenantId()); - Assertions.assertEquals("gmbmbexppbh", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("qrolfpf", model.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingInnerTests.java deleted file mode 100644 index 7f593b628c60..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; -import org.junit.jupiter.api.Assertions; - -public final class ArcSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcSettingInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"arcInstanceResourceGroup\":\"msbzjhcrz\",\"arcApplicationClientId\":\"dphlxaolt\",\"arcApplicationTenantId\":\"trg\",\"arcServicePrincipalObjectId\":\"bpf\",\"arcApplicationObjectId\":\"s\",\"aggregateState\":\"DisableInProgress\",\"perNodeDetails\":[{\"name\":\"cjrwzoxxjtfellu\",\"arcInstance\":\"zitonpeqfpjkjl\",\"arcNodeServicePrincipalObjectId\":\"fpdvhpfxxypi\",\"state\":\"InProgress\"}],\"connectivityProperties\":\"dataayhuy\",\"defaultExtensions\":[{\"category\":\"odepoogin\",\"consentTime\":\"2021-04-24T19:55:27Z\"},{\"category\":\"iheogna\",\"consentTime\":\"2021-08-23T15:48:59Z\"}]},\"id\":\"theotusiv\",\"name\":\"evcciqihnhun\",\"type\":\"bwjzr\"}") - .toObject(ArcSettingInner.class); - Assertions.assertEquals("msbzjhcrz", model.arcInstanceResourceGroup()); - Assertions.assertEquals("dphlxaolt", model.arcApplicationClientId()); - Assertions.assertEquals("trg", model.arcApplicationTenantId()); - Assertions.assertEquals("bpf", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("s", model.arcApplicationObjectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcSettingInner model = new ArcSettingInner().withArcInstanceResourceGroup("msbzjhcrz") - .withArcApplicationClientId("dphlxaolt") - .withArcApplicationTenantId("trg") - .withArcServicePrincipalObjectId("bpf") - .withArcApplicationObjectId("s") - .withConnectivityProperties("dataayhuy"); - model = BinaryData.fromObject(model).toObject(ArcSettingInner.class); - Assertions.assertEquals("msbzjhcrz", model.arcInstanceResourceGroup()); - Assertions.assertEquals("dphlxaolt", model.arcApplicationClientId()); - Assertions.assertEquals("trg", model.arcApplicationTenantId()); - Assertions.assertEquals("bpf", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("s", model.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingListTests.java deleted file mode 100644 index 5117e4e3b9de..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingListTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingList; - -public final class ArcSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcSettingList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Disconnected\",\"arcInstanceResourceGroup\":\"gjxpybczmehmt\",\"arcApplicationClientId\":\"pbsphrupidgs\",\"arcApplicationTenantId\":\"bejhphoycmsxa\",\"arcServicePrincipalObjectId\":\"hdxbmtqio\",\"arcApplicationObjectId\":\"zehtbmu\",\"aggregateState\":\"Connected\",\"perNodeDetails\":[{\"name\":\"izhwlrxy\",\"arcInstance\":\"soqijg\",\"arcNodeServicePrincipalObjectId\":\"mbpazlobcufpdzn\",\"state\":\"Connected\"}],\"connectivityProperties\":\"dataqqjnqgl\",\"defaultExtensions\":[{\"category\":\"ufo\",\"consentTime\":\"2021-10-05T18:29:36Z\"},{\"category\":\"wifsq\",\"consentTime\":\"2021-08-09T09:02:18Z\"}]},\"id\":\"gdf\",\"name\":\"glzlhjxrifkwmrv\",\"type\":\"tsizntocipaoua\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"arcInstanceResourceGroup\":\"cmpoyfdkfogkny\",\"arcApplicationClientId\":\"ofjdde\",\"arcApplicationTenantId\":\"rd\",\"arcServicePrincipalObjectId\":\"pewnw\",\"arcApplicationObjectId\":\"itjz\",\"aggregateState\":\"Moving\",\"perNodeDetails\":[{\"name\":\"rh\",\"arcInstance\":\"fcqhsmyurkd\",\"arcNodeServicePrincipalObjectId\":\"lx\",\"state\":\"Disconnected\"},{\"name\":\"k\",\"arcInstance\":\"txukcdmp\",\"arcNodeServicePrincipalObjectId\":\"cryuan\",\"state\":\"Provisioning\"}],\"connectivityProperties\":\"datazdxtayrlhmwhf\",\"defaultExtensions\":[{\"category\":\"obmtukk\",\"consentTime\":\"2021-03-16T09:48:53Z\"},{\"category\":\"tihfx\",\"consentTime\":\"2021-07-26T10:14:38Z\"}]},\"id\":\"pzvgnwzsymglzufc\",\"name\":\"zk\",\"type\":\"hdbihan\"},{\"properties\":{\"provisioningState\":\"PartiallyConnected\",\"arcInstanceResourceGroup\":\"bj\",\"arcApplicationClientId\":\"a\",\"arcApplicationTenantId\":\"th\",\"arcServicePrincipalObjectId\":\"hab\",\"arcApplicationObjectId\":\"pikxwczbyscnpqxu\",\"aggregateState\":\"Succeeded\",\"perNodeDetails\":[{\"name\":\"iwbybrkxvdumjg\",\"arcInstance\":\"fwvuk\",\"arcNodeServicePrincipalObjectId\":\"audccsnhs\",\"state\":\"Disconnected\"},{\"name\":\"ejhkry\",\"arcInstance\":\"napczwlokjy\",\"arcNodeServicePrincipalObjectId\":\"kkvnipjox\",\"state\":\"Accepted\"},{\"name\":\"hgejspodma\",\"arcInstance\":\"zyde\",\"arcNodeServicePrincipalObjectId\":\"jwyahuxinpmqnja\",\"state\":\"Creating\"},{\"name\":\"jsprozvcpute\",\"arcInstance\":\"vwmf\",\"arcNodeServicePrincipalObjectId\":\"t\",\"state\":\"InProgress\"}],\"connectivityProperties\":\"datavpjhulsuuv\",\"defaultExtensions\":[{\"category\":\"zkrwfn\",\"consentTime\":\"2021-07-16T00:56:28Z\"},{\"category\":\"jpslwejd\",\"consentTime\":\"2021-02-19T06:09:33Z\"},{\"category\":\"yoqpsoaccta\",\"consentTime\":\"2021-06-15T10:03:50Z\"}]},\"id\":\"j\",\"name\":\"ahbc\",\"type\":\"yffdfdos\"}],\"nextLink\":\"expa\"}") - .toObject(ArcSettingList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcSettingList model = new ArcSettingList(); - model = BinaryData.fromObject(model).toObject(ArcSettingList.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingPropertiesTests.java deleted file mode 100644 index 1bda1ff8bd3d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class ArcSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcSettingProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Deleted\",\"arcInstanceResourceGroup\":\"xgispemvtzfkufu\",\"arcApplicationClientId\":\"jofxqe\",\"arcApplicationTenantId\":\"jaeq\",\"arcServicePrincipalObjectId\":\"qjbasvms\",\"arcApplicationObjectId\":\"qulngsntnbybkzgc\",\"aggregateState\":\"Updating\",\"perNodeDetails\":[{\"name\":\"xwrljdouskcqvkoc\",\"arcInstance\":\"jdkwtnhxbnjb\",\"arcNodeServicePrincipalObjectId\":\"sqrglssainq\",\"state\":\"PartiallyConnected\"},{\"name\":\"zlljfmppeebvm\",\"arcInstance\":\"sabkyqduujitcjcz\",\"arcNodeServicePrincipalObjectId\":\"evndh\",\"state\":\"Canceled\"},{\"name\":\"d\",\"arcInstance\":\"p\",\"arcNodeServicePrincipalObjectId\":\"bdkvwrwjf\",\"state\":\"Disconnected\"},{\"name\":\"hutje\",\"arcInstance\":\"mrldhu\",\"arcNodeServicePrincipalObjectId\":\"zzd\",\"state\":\"Accepted\"}],\"connectivityProperties\":\"datahocdgeab\",\"defaultExtensions\":[{\"category\":\"uticndvkaozwyif\",\"consentTime\":\"2021-08-07T23:12:54Z\"}]}") - .toObject(ArcSettingProperties.class); - Assertions.assertEquals("xgispemvtzfkufu", model.arcInstanceResourceGroup()); - Assertions.assertEquals("jofxqe", model.arcApplicationClientId()); - Assertions.assertEquals("jaeq", model.arcApplicationTenantId()); - Assertions.assertEquals("qjbasvms", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("qulngsntnbybkzgc", model.arcApplicationObjectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcSettingProperties model = new ArcSettingProperties().withArcInstanceResourceGroup("xgispemvtzfkufu") - .withArcApplicationClientId("jofxqe") - .withArcApplicationTenantId("jaeq") - .withArcServicePrincipalObjectId("qjbasvms") - .withArcApplicationObjectId("qulngsntnbybkzgc") - .withConnectivityProperties("datahocdgeab"); - model = BinaryData.fromObject(model).toObject(ArcSettingProperties.class); - Assertions.assertEquals("xgispemvtzfkufu", model.arcInstanceResourceGroup()); - Assertions.assertEquals("jofxqe", model.arcApplicationClientId()); - Assertions.assertEquals("jaeq", model.arcApplicationTenantId()); - Assertions.assertEquals("qjbasvms", model.arcServicePrincipalObjectId()); - Assertions.assertEquals("qulngsntnbybkzgc", model.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsWithResponseMockTests.java deleted file mode 100644 index b9f42d81989a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsConsentAndInstallDefaultExtensionsWithResponseMockTests { - @Test - public void testConsentAndInstallDefaultExtensionsWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Provisioning\",\"arcInstanceResourceGroup\":\"tyvkunmignohi\",\"arcApplicationClientId\":\"gqogjwpindedva\",\"arcApplicationTenantId\":\"xbhmed\",\"arcServicePrincipalObjectId\":\"lbjywfcfxzirzzih\",\"arcApplicationObjectId\":\"ypusuvjslczwci\",\"aggregateState\":\"Canceled\",\"perNodeDetails\":[{\"name\":\"fryvdmvxadqac\",\"arcInstance\":\"gna\",\"arcNodeServicePrincipalObjectId\":\"a\",\"state\":\"NotSpecified\"},{\"name\":\"ktyjmf\",\"arcInstance\":\"l\",\"arcNodeServicePrincipalObjectId\":\"yq\",\"state\":\"Accepted\"},{\"name\":\"zgowox\",\"arcInstance\":\"je\",\"arcNodeServicePrincipalObjectId\":\"cxn\",\"state\":\"Succeeded\"},{\"name\":\"hlusrvxisi\",\"arcInstance\":\"ceagbjqvlsumywz\",\"arcNodeServicePrincipalObjectId\":\"hxgonoyjf\",\"state\":\"PartiallySucceeded\"}],\"connectivityProperties\":\"datab\",\"defaultExtensions\":[{\"category\":\"lkfk\",\"consentTime\":\"2021-08-22T16:22:42Z\"},{\"category\":\"vop\",\"consentTime\":\"2021-10-07T20:58:36Z\"},{\"category\":\"oqujlyegqavn\",\"consentTime\":\"2021-07-31T00:26:04Z\"}]},\"id\":\"qqbtny\",\"name\":\"pylx\",\"type\":\"bf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ArcSetting response = manager.arcSettings() - .consentAndInstallDefaultExtensionsWithResponse("va", "caszk", "xk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tyvkunmignohi", response.arcInstanceResourceGroup()); - Assertions.assertEquals("gqogjwpindedva", response.arcApplicationClientId()); - Assertions.assertEquals("xbhmed", response.arcApplicationTenantId()); - Assertions.assertEquals("lbjywfcfxzirzzih", response.arcServicePrincipalObjectId()); - Assertions.assertEquals("ypusuvjslczwci", response.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentityMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentityMockTests.java deleted file mode 100644 index 8c41676f4148..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentityMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsCreateIdentityMockTests { - @Test - public void testCreateIdentity() throws Exception { - String responseStr - = "{\"properties\":{\"arcApplicationClientId\":\"fejdoqeykglty\",\"arcApplicationTenantId\":\"hqfgqkayejsx\",\"arcServicePrincipalObjectId\":\"gflwfgziiucijj\",\"arcApplicationObjectId\":\"atlijjjr\"}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ArcIdentityResponse response - = manager.arcSettings().createIdentity("x", "cakiqao", "djrkclamggl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateWithResponseMockTests.java deleted file mode 100644 index e296dfd78578..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,50 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"PartiallySucceeded\",\"arcInstanceResourceGroup\":\"lgcndhzxrrfcfsrh\",\"arcApplicationClientId\":\"gsnxuw\",\"arcApplicationTenantId\":\"pphefsbzx\",\"arcServicePrincipalObjectId\":\"zxomeikjclwz\",\"arcApplicationObjectId\":\"nmwpf\",\"aggregateState\":\"NotSpecified\",\"perNodeDetails\":[{\"name\":\"zyqbxyxoyfpuq\",\"arcInstance\":\"qezxlhdj\",\"arcNodeServicePrincipalObjectId\":\"dcadwvpsozjiihjr\",\"state\":\"Deleting\"},{\"name\":\"rz\",\"arcInstance\":\"pnx\",\"arcNodeServicePrincipalObjectId\":\"v\",\"state\":\"Updating\"},{\"name\":\"gv\",\"arcInstance\":\"mxaursqftibtyi\",\"arcNodeServicePrincipalObjectId\":\"yvp\",\"state\":\"Deleted\"},{\"name\":\"jpnqnoowsbeden\",\"arcInstance\":\"xkxbhxvu\",\"arcNodeServicePrincipalObjectId\":\"ulgm\",\"state\":\"DisableInProgress\"}],\"connectivityProperties\":\"datavdyznf\",\"defaultExtensions\":[{\"category\":\"kskmqozzkivyhjrl\",\"consentTime\":\"2021-11-04T07:10:22Z\"},{\"category\":\"ixlqfhefkwabsolr\",\"consentTime\":\"2021-04-28T07:30:05Z\"},{\"category\":\"lmgnlqxsjx\",\"consentTime\":\"2021-09-23T03:21:08Z\"}]},\"id\":\"xhvuqbozool\",\"name\":\"qocarkuzlbc\",\"type\":\"ndtsnxawqytll\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ArcSetting response = manager.arcSettings() - .define("yeofltfnnxrkad") - .withExistingCluster("kzwjiqullq", "bdmvrscmqerndbr") - .withArcInstanceResourceGroup("fmu") - .withArcApplicationClientId("iripfohyk") - .withArcApplicationTenantId("xbbcbrw") - .withArcServicePrincipalObjectId("u") - .withArcApplicationObjectId("njizb") - .withConnectivityProperties("datarevkaapezkis") - .create(); - - Assertions.assertEquals("lgcndhzxrrfcfsrh", response.arcInstanceResourceGroup()); - Assertions.assertEquals("gsnxuw", response.arcApplicationClientId()); - Assertions.assertEquals("pphefsbzx", response.arcApplicationTenantId()); - Assertions.assertEquals("zxomeikjclwz", response.arcServicePrincipalObjectId()); - Assertions.assertEquals("nmwpf", response.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteMockTests.java deleted file mode 100644 index 6e58105e061f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.arcSettings().delete("ngucaifpaurww", "ilfjqqacdmk", "wxdcvjwcyz", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetWithResponseMockTests.java deleted file mode 100644 index fde9e18d5371..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Creating\",\"arcInstanceResourceGroup\":\"t\",\"arcApplicationClientId\":\"ikizbcu\",\"arcApplicationTenantId\":\"bvntnrgmqsorhce\",\"arcServicePrincipalObjectId\":\"gnlykm\",\"arcApplicationObjectId\":\"pwzvmdoksqdti\",\"aggregateState\":\"DisableInProgress\",\"perNodeDetails\":[{\"name\":\"oncqbazqicqch\",\"arcInstance\":\"tvx\",\"arcNodeServicePrincipalObjectId\":\"janepubdpkx\",\"state\":\"PartiallySucceeded\"},{\"name\":\"xiaodet\",\"arcInstance\":\"hkxdxuwsaifmc\",\"arcNodeServicePrincipalObjectId\":\"osbz\",\"state\":\"Succeeded\"},{\"name\":\"cvk\",\"arcInstance\":\"knjolgjyyxpve\",\"arcNodeServicePrincipalObjectId\":\"zerqzevxoqei\",\"state\":\"Connected\"},{\"name\":\"aljglzobl\",\"arcInstance\":\"aafrqulhmzyqbhd\",\"arcNodeServicePrincipalObjectId\":\"fjrqpjiyr\",\"state\":\"Deleted\"}],\"connectivityProperties\":\"datagaxwmzwdfkbnrzo\",\"defaultExtensions\":[{\"category\":\"tbqctqjfgx\",\"consentTime\":\"2021-01-03T19:23:32Z\"}]},\"id\":\"tgzdgv\",\"name\":\"yig\",\"type\":\"aqqilzdcduwjoed\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ArcSetting response = manager.arcSettings() - .getWithResponse("jomevtfycnlb", "gjco", "kk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("t", response.arcInstanceResourceGroup()); - Assertions.assertEquals("ikizbcu", response.arcApplicationClientId()); - Assertions.assertEquals("bvntnrgmqsorhce", response.arcApplicationTenantId()); - Assertions.assertEquals("gnlykm", response.arcServicePrincipalObjectId()); - Assertions.assertEquals("pwzvmdoksqdti", response.arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessMockTests.java deleted file mode 100644 index 82821a4cfb1a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsInitializeDisableProcessMockTests { - @Test - public void testInitializeDisableProcess() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.arcSettings() - .initializeDisableProcess("abmvmsxbaevwjc", "kottlwuhvajmailf", "mjjz", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterMockTests.java deleted file mode 100644 index 0ddba175c9b6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ArcSetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ArcSettingsListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"PartiallySucceeded\",\"arcInstanceResourceGroup\":\"xyfukzxuizhyhn\",\"arcApplicationClientId\":\"kpetiarxq\",\"arcApplicationTenantId\":\"bxdukecpxdazvd\",\"arcServicePrincipalObjectId\":\"tmmkosz\",\"arcApplicationObjectId\":\"blnsntrpcaqk\",\"aggregateState\":\"Deleting\",\"perNodeDetails\":[{\"name\":\"fmhklbnld\",\"arcInstance\":\"cbhhez\",\"arcNodeServicePrincipalObjectId\":\"u\",\"state\":\"PartiallySucceeded\"},{\"name\":\"xut\",\"arcInstance\":\"brruyuuatv\",\"arcNodeServicePrincipalObjectId\":\"bjwcolbmx\",\"state\":\"Connected\"},{\"name\":\"tpc\",\"arcInstance\":\"hprzrvxhmtfho\",\"arcNodeServicePrincipalObjectId\":\"xzcmjhngxno\",\"state\":\"Connected\"},{\"name\":\"disnj\",\"arcInstance\":\"hdlmydidwhe\",\"arcNodeServicePrincipalObjectId\":\"wwtjfdoesxxhmwc\",\"state\":\"Canceled\"}],\"connectivityProperties\":\"datayo\",\"defaultExtensions\":[{\"category\":\"xhn\",\"consentTime\":\"2021-05-20T23:38:08Z\"},{\"category\":\"jzrbhtmeplv\",\"consentTime\":\"2020-12-21T01:54:28Z\"},{\"category\":\"brlbpgs\",\"consentTime\":\"2021-08-24T01:01:07Z\"},{\"category\":\"nchjhgemuowakywa\",\"consentTime\":\"2021-05-09T15:29:15Z\"}]},\"id\":\"m\",\"name\":\"cgqtag\",\"type\":\"rclsso\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.arcSettings().listByCluster("iisb", "mnppccekuztd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xyfukzxuizhyhn", response.iterator().next().arcInstanceResourceGroup()); - Assertions.assertEquals("kpetiarxq", response.iterator().next().arcApplicationClientId()); - Assertions.assertEquals("bxdukecpxdazvd", response.iterator().next().arcApplicationTenantId()); - Assertions.assertEquals("tmmkosz", response.iterator().next().arcServicePrincipalObjectId()); - Assertions.assertEquals("blnsntrpcaqk", response.iterator().next().arcApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchPropertiesTests.java deleted file mode 100644 index 6dfe90cfa612..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingsPatchProperties; - -public final class ArcSettingsPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcSettingsPatchProperties model = BinaryData.fromString("{\"connectivityProperties\":\"datae\"}") - .toObject(ArcSettingsPatchProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcSettingsPatchProperties model = new ArcSettingsPatchProperties().withConnectivityProperties("datae"); - model = BinaryData.fromObject(model).toObject(ArcSettingsPatchProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchTests.java deleted file mode 100644 index 786ab793cee0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsPatchTests.java +++ /dev/null @@ -1,42 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ArcSettingsPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcSettingsPatch model = BinaryData.fromString( - "{\"tags\":{\"nqgoulzndli\":\"hsgcbacphejkot\",\"dgak\":\"wyqkgfgibm\"},\"properties\":{\"connectivityProperties\":\"datarxybz\"}}") - .toObject(ArcSettingsPatch.class); - Assertions.assertEquals("hsgcbacphejkot", model.tags().get("nqgoulzndli")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcSettingsPatch model - = new ArcSettingsPatch().withTags(mapOf("nqgoulzndli", "hsgcbacphejkot", "dgak", "wyqkgfgibm")) - .withConnectivityProperties("datarxybz"); - model = BinaryData.fromObject(model).toObject(ArcSettingsPatch.class); - Assertions.assertEquals("hsgcbacphejkot", model.tags().get("nqgoulzndli")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterDesiredPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterDesiredPropertiesTests.java deleted file mode 100644 index 5d49ac02c9a2..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterDesiredPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import org.junit.jupiter.api.Assertions; - -public final class ClusterDesiredPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterDesiredProperties model - = BinaryData.fromString("{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Enhanced\"}") - .toObject(ClusterDesiredProperties.class); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, model.windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.ENHANCED, model.diagnosticLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterDesiredProperties model - = new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.ENHANCED); - model = BinaryData.fromObject(model).toObject(ClusterDesiredProperties.class); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, model.windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.ENHANCED, model.diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponseInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponseInnerTests.java deleted file mode 100644 index 4685ce7a890c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponseInnerTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; - -public final class ClusterIdentityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterIdentityResponseInner model = BinaryData.fromString( - "{\"properties\":{\"aadClientId\":\"ooxdjebwpuc\",\"aadTenantId\":\"fvovbvmeuecivy\",\"aadServicePrincipalObjectId\":\"ce\",\"aadApplicationObjectId\":\"jgjrwjueiotwm\"}}") - .toObject(ClusterIdentityResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterIdentityResponseInner model = new ClusterIdentityResponseInner(); - model = BinaryData.fromObject(model).toObject(ClusterIdentityResponseInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponsePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponsePropertiesTests.java deleted file mode 100644 index 5e36639c638b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterIdentityResponsePropertiesTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class ClusterIdentityResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterIdentityResponseProperties model = BinaryData.fromString( - "{\"aadClientId\":\"ytdxwit\",\"aadTenantId\":\"rjaw\",\"aadServicePrincipalObjectId\":\"wgxhn\",\"aadApplicationObjectId\":\"kxfbkpycgklwndn\"}") - .toObject(ClusterIdentityResponseProperties.class); - Assertions.assertEquals("ytdxwit", model.aadClientId()); - Assertions.assertEquals("rjaw", model.aadTenantId()); - Assertions.assertEquals("wgxhn", model.aadServicePrincipalObjectId()); - Assertions.assertEquals("kxfbkpycgklwndn", model.aadApplicationObjectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterIdentityResponseProperties model = new ClusterIdentityResponseProperties().withAadClientId("ytdxwit") - .withAadTenantId("rjaw") - .withAadServicePrincipalObjectId("wgxhn") - .withAadApplicationObjectId("kxfbkpycgklwndn"); - model = BinaryData.fromObject(model).toObject(ClusterIdentityResponseProperties.class); - Assertions.assertEquals("ytdxwit", model.aadClientId()); - Assertions.assertEquals("rjaw", model.aadTenantId()); - Assertions.assertEquals("wgxhn", model.aadServicePrincipalObjectId()); - Assertions.assertEquals("kxfbkpycgklwndn", model.aadApplicationObjectId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterListTests.java deleted file mode 100644 index 9b7d2138854f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterListTests.java +++ /dev/null @@ -1,149 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterList; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionProperties; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; -import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterList model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"3abe74f6-a3d1-4c29-9b5e-12abc6e76a6f\",\"tenantId\":\"c2959bdd-2f97-4179-9732-e92591811f36\",\"type\":\"None\",\"userAssignedIdentities\":{\"jyj\":{\"principalId\":\"0f28a43e-e014-4ccd-8c6e-efdb54f0ff05\",\"clientId\":\"c3a6f3d2-061c-4fb9-8a13-42785e3735ec\"},\"aoyfhrtxilnerkuj\":{\"principalId\":\"4015ac4b-c739-4228-8c8e-4bbb6993f31c\",\"clientId\":\"9a549f0a-e272-47f3-be3b-64f95b56e1c2\"},\"l\":{\"principalId\":\"8f97f6aa-f1f3-41b0-bfc4-580996c7395a\",\"clientId\":\"a8038c1a-dca9-4011-9ab0-f0456799fc33\"},\"vfqawrlyxwjkcpr\":{\"principalId\":\"d51462af-b261-414a-96c5-b940baf5ae8e\",\"clientId\":\"710d2c46-5c16-4009-ba22-cc93f11dc964\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"DeploymentFailed\",\"connectivityStatus\":\"Connected\",\"cloudId\":\"bvpyss\",\"cloudManagementEndpoint\":\"nruj\",\"aadClientId\":\"uhmuouqfprwzwbn\",\"aadTenantId\":\"itnwuizgazxufi\",\"aadApplicationObjectId\":\"ckyfih\",\"aadServicePrincipalObjectId\":\"idf\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Enable\",\"lastUpdated\":\"2021-04-15T03:14:07Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-10-17T08:51:50Z\",\"toDate\":\"2021-06-04T23:46:10Z\",\"lastLogGenerated\":\"2021-02-04T19:12:37Z\",\"logCollectionSessionDetails\":[{},{},{},{}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-10-31T03:21:56Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{},{},{},{}],\"remoteSupportSessionDetails\":[{},{},{}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"mmxdcu\",\"clusterId\":\"fsrpymzidnse\",\"clusterVersion\":\"xtbzsgfyccsne\",\"nodes\":[{},{},{}],\"lastUpdated\":\"2021-09-03T07:34:10Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Off\",\"supportedCapabilities\":[\"boo\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"ro\",\"oemActivation\":\"Disabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"eeh\",\"relyingPartyServiceEndpoint\":\"vypyqrimzinpv\",\"attestationServiceEndpoint\":\"jdkirsoodqx\"},\"trialDaysRemaining\":34.670513,\"billingModel\":\"nohjt\",\"registrationTimestamp\":\"2020-12-26T05:08:12Z\",\"lastSyncTimestamp\":\"2021-01-23T02:14:07Z\",\"lastBillingTimestamp\":\"2021-05-11T08:11:32Z\",\"serviceEndpoint\":\"fiyipjxsqwpgrj\",\"resourceProviderObjectId\":\"norcjxvsnbyxqab\"},\"location\":\"ocpcy\",\"tags\":{\"klj\":\"rzafbljjgpbtoqcj\",\"qajzyulpkudjkr\":\"vbqid\"},\"id\":\"khbzhfepgzg\",\"name\":\"e\",\"type\":\"zloc\"},{\"identity\":{\"principalId\":\"6f5a9762-c534-42d7-a8fe-fddaf1c9594f\",\"tenantId\":\"953b261b-1ce5-4716-b460-57948cc62be8\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"hbcsgl\":{\"principalId\":\"9d821af1-1a99-4514-b278-98729c5e3168\",\"clientId\":\"071a1122-43fb-4701-879a-cc04599c38d6\"},\"a\":{\"principalId\":\"707cddfe-4232-404a-b993-174940064526\",\"clientId\":\"fe75d49c-6503-48e2-83dc-90cc491d3aff\"},\"aodxo\":{\"principalId\":\"fa43fba5-041f-4d34-9893-371620415d6b\",\"clientId\":\"89d8af03-1e1d-4b4d-a091-8face594b5ba\"}}},\"properties\":{\"provisioningState\":\"Failed\",\"status\":\"Disconnected\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"okaj\",\"cloudManagementEndpoint\":\"npime\",\"aadClientId\":\"stxgc\",\"aadTenantId\":\"dg\",\"aadApplicationObjectId\":\"ajrmvdjwzrlovmc\",\"aadServicePrincipalObjectId\":\"hijco\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-07-24T11:38:54Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-02-04T17:33:10Z\",\"toDate\":\"2021-10-17T01:50:40Z\",\"lastLogGenerated\":\"2021-02-18T20:34:43Z\",\"logCollectionSessionDetails\":[{},{},{},{}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-04-20T10:26:18Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{},{},{},{}],\"remoteSupportSessionDetails\":[{}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"fjpgddtocjjxhvp\",\"clusterId\":\"uexhdzx\",\"clusterVersion\":\"qeojnxqbzvddntw\",\"nodes\":[{}],\"lastUpdated\":\"2021-05-28T18:35Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"aoqvuh\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"fcyddg\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"jqkwpyeicx\",\"relyingPartyServiceEndpoint\":\"ciwqvhk\",\"attestationServiceEndpoint\":\"xuigdtopbobj\"},\"trialDaysRemaining\":11.501741,\"billingModel\":\"e\",\"registrationTimestamp\":\"2021-07-13T01:02:50Z\",\"lastSyncTimestamp\":\"2021-01-02T08:53:50Z\",\"lastBillingTimestamp\":\"2021-01-27T21:23:24Z\",\"serviceEndpoint\":\"z\",\"resourceProviderObjectId\":\"vvtpgvdfgio\"},\"location\":\"ftutqxlngxlefgu\",\"tags\":{\"mi\":\"krxd\",\"abhjybi\":\"tthzrvqd\"},\"id\":\"ehoqfbowskan\",\"name\":\"ktzlcuiywg\",\"type\":\"ywgndrv\"},{\"identity\":{\"principalId\":\"57cb75eb-22a0-4204-8a42-05b2d9cbd8b0\",\"tenantId\":\"793e3cca-5706-4710-b366-834ba7c36df1\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"cgyncocpecf\":{\"principalId\":\"7eed1082-4c2e-48db-b829-79bae6d5d11f\",\"clientId\":\"c528e79c-024a-40cd-81f9-8d8f30c877df\"},\"coofsxlzev\":{\"principalId\":\"ad814dff-88b6-477c-b8cc-bac65d2905be\",\"clientId\":\"0dc3c164-818d-4af8-8068-584487b5292d\"},\"qjqabcypmivkwl\":{\"principalId\":\"144bc005-b61f-4cfa-b882-6f02dc954eb9\",\"clientId\":\"1c0aa821-3310-456a-9913-beadf5f8b363\"}}},\"properties\":{\"provisioningState\":\"DisableInProgress\",\"status\":\"NotSpecified\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"nbacfi\",\"cloudManagementEndpoint\":\"l\",\"aadClientId\":\"x\",\"aadTenantId\":\"qgtz\",\"aadApplicationObjectId\":\"pnqbqqwxrjfe\",\"aadServicePrincipalObjectId\":\"lnwsubisn\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Enabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-03-01T16:11:14Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-05-16T06:09:12Z\",\"toDate\":\"2021-11-21T01:43:49Z\",\"lastLogGenerated\":\"2021-08-23T00:35:40Z\",\"logCollectionSessionDetails\":[{},{},{},{}]},\"remoteSupportProperties\":{\"accessLevel\":\"Diagnostics\",\"expirationTimeStamp\":\"2021-01-15T20:14:13Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{},{}],\"remoteSupportSessionDetails\":[{},{},{},{}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Enhanced\"},\"reportedProperties\":{\"clusterName\":\"seiphe\",\"clusterId\":\"lokeyy\",\"clusterVersion\":\"nj\",\"nodes\":[{},{},{}],\"lastUpdated\":\"2021-10-26T11:35:52Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"pj\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"xazjpqyegual\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"e\",\"relyingPartyServiceEndpoint\":\"zzvdudgwds\",\"attestationServiceEndpoint\":\"hotwmcynpwlbjnp\"},\"trialDaysRemaining\":39.36754,\"billingModel\":\"tadehxnltyfsopp\",\"registrationTimestamp\":\"2021-06-21T13:34:16Z\",\"lastSyncTimestamp\":\"2020-12-22T21:06:46Z\",\"lastBillingTimestamp\":\"2021-04-15T21:03:11Z\",\"serviceEndpoint\":\"dejbavo\",\"resourceProviderObjectId\":\"zdmohctbqvu\"},\"location\":\"xdn\",\"tags\":{\"azjdyggd\":\"owgujjugwdkcglhs\"},\"id\":\"jixhbk\",\"name\":\"ofqweykhmenevfye\",\"type\":\"fwhybcibvy\"},{\"identity\":{\"principalId\":\"84c2648e-4061-447a-9a9f-e8f43680a046\",\"tenantId\":\"40ea4519-5b48-44e2-8523-3479e0bc8ade\",\"type\":\"None\",\"userAssignedIdentities\":{\"aamdect\":{\"principalId\":\"e8e69ba9-c4c2-4397-85f6-280636474bdd\",\"clientId\":\"fec1990f-d375-4f3c-b9fa-204eb3b995cd\"},\"iqscjeypv\":{\"principalId\":\"da157403-7363-4264-8419-1d1e3d3b49f0\",\"clientId\":\"d9407878-4847-4f4a-a67c-faa9f7b7eacb\"}}},\"properties\":{\"provisioningState\":\"Deleted\",\"status\":\"ConnectedRecently\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"jrefovgmkqsle\",\"cloudManagementEndpoint\":\"vxyqjpkcattpngjc\",\"aadClientId\":\"czsqpjhvm\",\"aadTenantId\":\"jvnysounqe\",\"aadApplicationObjectId\":\"noae\",\"aadServicePrincipalObjectId\":\"fhyhltrpmopjmcma\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Enabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-10-23T10:51:29Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-05-27T00:11:36Z\",\"toDate\":\"2021-05-15T07:44:06Z\",\"lastLogGenerated\":\"2021-01-11T08:50:44Z\",\"logCollectionSessionDetails\":[{}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-10-28T19:56:48Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{},{},{}],\"remoteSupportSessionDetails\":[{},{},{},{}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Enabled\",\"diagnosticLevel\":\"Off\"},\"reportedProperties\":{\"clusterName\":\"axbezyiuo\",\"clusterId\":\"twhrdxwzywqsm\",\"clusterVersion\":\"ureximoryocfs\",\"nodes\":[{}],\"lastUpdated\":\"2021-10-09T18:45:34Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"i\",\"uxh\",\"yudxorrqnbp\",\"czvyifq\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"vjsllrmvvdfw\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"pulexxbczw\",\"relyingPartyServiceEndpoint\":\"uwiqzb\",\"attestationServiceEndpoint\":\"vsovmyokac\"},\"trialDaysRemaining\":41.273003,\"billingModel\":\"lhzdobp\",\"registrationTimestamp\":\"2021-10-04T03:33:51Z\",\"lastSyncTimestamp\":\"2021-08-24T14:10:03Z\",\"lastBillingTimestamp\":\"2021-03-22T21:31:03Z\",\"serviceEndpoint\":\"nchrkcciww\",\"resourceProviderObjectId\":\"uqkhrsajiwku\"},\"location\":\"oskg\",\"tags\":{\"dyjrrfbyaosv\":\"uuimjmvxieduug\"},\"id\":\"xc\",\"name\":\"onpc\",\"type\":\"hocohslkev\"}],\"nextLink\":\"ggzfbu\"}") - .toObject(ClusterList.class); - Assertions.assertEquals("ocpcy", model.value().get(0).location()); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.value().get(0).tags().get("klj")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).typeIdentityType()); - Assertions.assertEquals("nruj", model.value().get(0).cloudManagementEndpoint()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).aadClientId()); - Assertions.assertEquals("itnwuizgazxufi", model.value().get(0).aadTenantId()); - Assertions.assertEquals("ckyfih", model.value().get(0).aadApplicationObjectId()); - Assertions.assertEquals("idf", model.value().get(0).aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, - model.value().get(0).softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.value().get(0).desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, model.value().get(0).desiredProperties().diagnosticLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterList model - = new ClusterList() - .withValue( - Arrays - .asList( - new ClusterInner().withLocation("ocpcy") - .withTags(mapOf("klj", "rzafbljjgpbtoqcj", "qajzyulpkudjkr", "vbqid")) - .withTypeIdentityType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("jyj", new UserAssignedIdentity(), "aoyfhrtxilnerkuj", - new UserAssignedIdentity(), "l", new UserAssignedIdentity(), "vfqawrlyxwjkcpr", - new UserAssignedIdentity())) - .withCloudManagementEndpoint("nruj") - .withAadClientId("uhmuouqfprwzwbn") - .withAadTenantId("itnwuizgazxufi") - .withAadApplicationObjectId("ckyfih") - .withAadServicePrincipalObjectId("idf") - .withSoftwareAssuranceProperties(new SoftwareAssuranceProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)) - .withLogCollectionProperties(new LogCollectionProperties()) - .withRemoteSupportProperties(new RemoteSupportProperties()) - .withDesiredProperties(new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.BASIC)), - new ClusterInner().withLocation("ftutqxlngxlefgu") - .withTags(mapOf("mi", "krxd", "abhjybi", "tthzrvqd")) - .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("hbcsgl", new UserAssignedIdentity(), "a", - new UserAssignedIdentity(), "aodxo", new UserAssignedIdentity())) - .withCloudManagementEndpoint("npime") - .withAadClientId("stxgc") - .withAadTenantId("dg") - .withAadApplicationObjectId("ajrmvdjwzrlovmc") - .withAadServicePrincipalObjectId("hijco") - .withSoftwareAssuranceProperties(new SoftwareAssuranceProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE)) - .withLogCollectionProperties(new LogCollectionProperties()) - .withRemoteSupportProperties(new RemoteSupportProperties()) - .withDesiredProperties(new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.BASIC)), - new ClusterInner().withLocation("xdn") - .withTags(mapOf("azjdyggd", "owgujjugwdkcglhs")) - .withTypeIdentityType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("cgyncocpecf", new UserAssignedIdentity(), "coofsxlzev", - new UserAssignedIdentity(), "qjqabcypmivkwl", new UserAssignedIdentity())) - .withCloudManagementEndpoint("l") - .withAadClientId("x") - .withAadTenantId("qgtz") - .withAadApplicationObjectId("pnqbqqwxrjfe") - .withAadServicePrincipalObjectId("lnwsubisn") - .withSoftwareAssuranceProperties(new SoftwareAssuranceProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE)) - .withLogCollectionProperties(new LogCollectionProperties()) - .withRemoteSupportProperties(new RemoteSupportProperties()) - .withDesiredProperties(new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.ENHANCED)), - new ClusterInner().withLocation("oskg") - .withTags(mapOf("dyjrrfbyaosv", "uuimjmvxieduug")) - .withTypeIdentityType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("aamdect", new UserAssignedIdentity(), "iqscjeypv", - new UserAssignedIdentity())) - .withCloudManagementEndpoint("vxyqjpkcattpngjc") - .withAadClientId("czsqpjhvm") - .withAadTenantId("jvnysounqe") - .withAadApplicationObjectId("noae") - .withAadServicePrincipalObjectId("fhyhltrpmopjmcma") - .withSoftwareAssuranceProperties(new SoftwareAssuranceProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE)) - .withLogCollectionProperties(new LogCollectionProperties()) - .withRemoteSupportProperties(new RemoteSupportProperties()) - .withDesiredProperties(new ClusterDesiredProperties() - .withWindowsServerSubscription(WindowsServerSubscription.ENABLED) - .withDiagnosticLevel(DiagnosticLevel.OFF)))); - model = BinaryData.fromObject(model).toObject(ClusterList.class); - Assertions.assertEquals("ocpcy", model.value().get(0).location()); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.value().get(0).tags().get("klj")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).typeIdentityType()); - Assertions.assertEquals("nruj", model.value().get(0).cloudManagementEndpoint()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).aadClientId()); - Assertions.assertEquals("itnwuizgazxufi", model.value().get(0).aadTenantId()); - Assertions.assertEquals("ckyfih", model.value().get(0).aadApplicationObjectId()); - Assertions.assertEquals("idf", model.value().get(0).aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, - model.value().get(0).softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.value().get(0).desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, model.value().get(0).desiredProperties().diagnosticLevel()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterNodeTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterNodeTests.java deleted file mode 100644 index e68437b25b09..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterNodeTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ClusterNode; - -public final class ClusterNodeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterNode model = BinaryData.fromString( - "{\"name\":\"mhjjdhtldwkyzx\",\"id\":39.051258,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"cwsvlxotog\",\"manufacturer\":\"rupqsxvnmicy\",\"model\":\"ceoveilovno\",\"osName\":\"fj\",\"osVersion\":\"njbkcnxdhbttkph\",\"osDisplayVersion\":\"pnvjtoqnermclf\",\"serialNumber\":\"phoxus\",\"coreCount\":47.54292,\"memoryInGiB\":47.44032,\"lastLicensingTimestamp\":\"2021-09-10T10:11:16Z\",\"oemActivation\":\"Disabled\"}") - .toObject(ClusterNode.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterNode model = new ClusterNode(); - model = BinaryData.fromObject(model).toObject(ClusterNode.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchPropertiesTests.java deleted file mode 100644 index 640f618858ea..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchPropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPatchProperties model = BinaryData.fromString( - "{\"cloudManagementEndpoint\":\"laexqp\",\"aadClientId\":\"adm\",\"aadTenantId\":\"rcrgvx\",\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Enhanced\"}}") - .toObject(ClusterPatchProperties.class); - Assertions.assertEquals("laexqp", model.cloudManagementEndpoint()); - Assertions.assertEquals("adm", model.aadClientId()); - Assertions.assertEquals("rcrgvx", model.aadTenantId()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.ENHANCED, model.desiredProperties().diagnosticLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPatchProperties model = new ClusterPatchProperties().withCloudManagementEndpoint("laexqp") - .withAadClientId("adm") - .withAadTenantId("rcrgvx") - .withDesiredProperties( - new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.ENHANCED)); - model = BinaryData.fromObject(model).toObject(ClusterPatchProperties.class); - Assertions.assertEquals("laexqp", model.cloudManagementEndpoint()); - Assertions.assertEquals("adm", model.aadClientId()); - Assertions.assertEquals("rcrgvx", model.aadTenantId()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.ENHANCED, model.desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchTests.java deleted file mode 100644 index 6fc04c03d7e9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterPatchTests.java +++ /dev/null @@ -1,69 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPatch model = BinaryData.fromString( - "{\"tags\":{\"g\":\"obglaocqxtcc\",\"wfudwpzntxhdzhl\":\"udxytlmoyrx\",\"hckfrlhrx\":\"qj\"},\"identity\":{\"principalId\":\"5b5b5a7e-4f90-47b8-980d-6dc8dfda626d\",\"tenantId\":\"16cb7545-8cd6-4328-b0aa-9f346c3b939b\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"n\":{\"principalId\":\"cdf2c07b-a565-4c59-88a0-380aa53c1120\",\"clientId\":\"9af84a5d-90d6-4fda-9b19-047e2cd5eb62\"},\"p\":{\"principalId\":\"e8e9ffc2-995c-48ba-8f4a-9d5ce978fb9a\",\"clientId\":\"a7778dcb-6252-4939-ab54-cce7d591e137\"},\"fkuwbcrnwbmehhse\":{\"principalId\":\"49d6f22e-261d-4a30-b039-ad64a91c6b1b\",\"clientId\":\"b57699f3-1bbf-4eba-a1f3-2676ae7eb43d\"},\"us\":{\"principalId\":\"c78a3401-c300-4bc7-bce9-02bea3f895fd\",\"clientId\":\"93439df9-dbb4-47cc-90db-7af65f5f597d\"}}},\"properties\":{\"cloudManagementEndpoint\":\"lhspkdee\",\"aadClientId\":\"ofmxagkvtmelmqkr\",\"aadTenantId\":\"hvljuahaquh\",\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Basic\"}}}") - .toObject(ClusterPatch.class); - Assertions.assertEquals("obglaocqxtcc", model.tags().get("g")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("lhspkdee", model.cloudManagementEndpoint()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.aadClientId()); - Assertions.assertEquals("hvljuahaquh", model.aadTenantId()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, model.desiredProperties().diagnosticLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPatch model = new ClusterPatch() - .withTags(mapOf("g", "obglaocqxtcc", "wfudwpzntxhdzhl", "udxytlmoyrx", "hckfrlhrx", "qj")) - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("n", new UserAssignedIdentity(), "p", new UserAssignedIdentity(), - "fkuwbcrnwbmehhse", new UserAssignedIdentity(), "us", new UserAssignedIdentity())) - .withCloudManagementEndpoint("lhspkdee") - .withAadClientId("ofmxagkvtmelmqkr") - .withAadTenantId("hvljuahaquh") - .withDesiredProperties( - new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.BASIC)); - model = BinaryData.fromObject(model).toObject(ClusterPatch.class); - Assertions.assertEquals("obglaocqxtcc", model.tags().get("g")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("lhspkdee", model.cloudManagementEndpoint()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.aadClientId()); - Assertions.assertEquals("hvljuahaquh", model.aadTenantId()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - model.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, model.desiredProperties().diagnosticLevel()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterReportedPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterReportedPropertiesTests.java deleted file mode 100644 index 28dfbdb6317f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClusterReportedPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import org.junit.jupiter.api.Assertions; - -public final class ClusterReportedPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterReportedProperties model = BinaryData.fromString( - "{\"clusterName\":\"xaepdkzjancuxr\",\"clusterId\":\"wbavxbniwdj\",\"clusterVersion\":\"zt\",\"nodes\":[{\"name\":\"gnxytxhpzxbz\",\"id\":65.9889,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"uhxwtctyqiklbbov\",\"manufacturer\":\"wzbhvgyugu\",\"model\":\"vmkfssxqu\",\"osName\":\"fpl\",\"osVersion\":\"gsxnkjzkdeslpv\",\"osDisplayVersion\":\"pwiyig\",\"serialNumber\":\"pkdwzbai\",\"coreCount\":69.34189,\"memoryInGiB\":3.11566,\"lastLicensingTimestamp\":\"2021-01-25T19:39:32Z\",\"oemActivation\":\"Enabled\"}],\"lastUpdated\":\"2021-10-03T00:53:14Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Off\",\"supportedCapabilities\":[\"nabckhsmtx\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"btfhvpesaps\",\"oemActivation\":\"Disabled\"}") - .toObject(ClusterReportedProperties.class); - Assertions.assertEquals(DiagnosticLevel.OFF, model.diagnosticLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterReportedProperties model = new ClusterReportedProperties().withDiagnosticLevel(DiagnosticLevel.OFF); - model = BinaryData.fromObject(model).toObject(ClusterReportedProperties.class); - Assertions.assertEquals(DiagnosticLevel.OFF, model.diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportMockTests.java deleted file mode 100644 index 56df7232cf72..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersConfigureRemoteSupportMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersConfigureRemoteSupportMockTests { - @Test - public void testConfigureRemoteSupport() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"83fc1202-d8a9-4a6f-9172-7acf49fbea20\",\"tenantId\":\"0961d115-1052-4bd1-a4c0-b1991ca99853\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"xu\":{\"principalId\":\"b575256c-1a67-4015-be42-e96585294269\",\"clientId\":\"213623c4-429b-415b-ae58-95f181870758\"},\"pfdvhaxdv\":{\"principalId\":\"cb1e61ed-addf-4b3b-87a9-026c6fa3efa3\",\"clientId\":\"08fe3015-ebd6-46b0-aeea-2caf89fb8073\"},\"ehpphthdklmveta\":{\"principalId\":\"aa5ba488-bf78-482b-89a1-ded65cb00e34\",\"clientId\":\"24f45df4-3c82-46b4-83b0-e8ca08d396fa\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"NotSpecified\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"wgiksbbvtoo\",\"cloudManagementEndpoint\":\"p\",\"aadClientId\":\"wp\",\"aadTenantId\":\"hgjtnhtukfaci\",\"aadApplicationObjectId\":\"bfntumeezbxvq\",\"aadServicePrincipalObjectId\":\"nuvwcgasgomtmjzw\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Enable\",\"lastUpdated\":\"2021-04-20T10:00:56Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-06-19T19:54:52Z\",\"toDate\":\"2021-08-06T00:39:29Z\",\"lastLogGenerated\":\"2021-02-10T04:05:47Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-02-07T23:38:04Z\",\"logEndTime\":\"2021-10-21T13:20:35Z\",\"timeCollected\":\"2021-08-23T00:31:41Z\",\"logSize\":4891435980141713838,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"ll\",\"endTimeCollected\":\"2021-10-05T03:59:42Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-11-03T13:45:26Z\",\"logEndTime\":\"2021-10-12T13:30:19Z\",\"timeCollected\":\"2021-03-16T03:23:22Z\",\"logSize\":2662581133111301135,\"logCollectionStatus\":\"InProgress\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"mlyotg\",\"endTimeCollected\":\"2021-01-04T07:08:54Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-05-06T10:13:33Z\",\"logEndTime\":\"2021-10-19T20:33:09Z\",\"timeCollected\":\"2021-02-14T10:44:54Z\",\"logSize\":8357561947868417233,\"logCollectionStatus\":\"None\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"bxeetqujxcxxqn\",\"endTimeCollected\":\"2021-08-16T20:52:08Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-04-15T05:07:22Z\",\"logEndTime\":\"2021-10-10T07:02:55Z\",\"timeCollected\":\"2021-05-20T04:42:02Z\",\"logSize\":7207641865244379752,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"v\",\"endTimeCollected\":\"2021-04-17T16:51:58Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-09-30T10:56:46Z\",\"remoteSupportType\":\"Enable\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"ilcchskxxkansbvr\",\"state\":\"qgvtojrulfu\",\"createdAt\":\"2021-09-20T21:53:57Z\",\"updatedAt\":\"2021-11-30T18:51:59Z\",\"connectionStatus\":\"hcfjzhxlyubqjro\",\"connectionErrorMessage\":\"vrjeqmtzzbeqrztr\",\"transcriptLocation\":\"lxrdhabsrwrsn\"},{\"arcResourceId\":\"pqatiwkkvyanxkv\",\"state\":\"semsvuvd\",\"createdAt\":\"2021-07-09T07:15:04Z\",\"updatedAt\":\"2021-03-06T23:53:15Z\",\"connectionStatus\":\"qmmlivrjjxnwx\",\"connectionErrorMessage\":\"hpojxl\",\"transcriptLocation\":\"z\"},{\"arcResourceId\":\"pgfquwzpwiibelwc\",\"state\":\"wkwbpjx\",\"createdAt\":\"2021-07-06T07:22:37Z\",\"updatedAt\":\"2021-05-19T01:42:55Z\",\"connectionStatus\":\"sqtbxxniu\",\"connectionErrorMessage\":\"dzhgbdgzpags\",\"transcriptLocation\":\"nadbu\"},{\"arcResourceId\":\"r\",\"state\":\"fllmqiy\",\"createdAt\":\"2021-08-15T19:08:33Z\",\"updatedAt\":\"2021-11-16T18:35:26Z\",\"connectionStatus\":\"nkkiiwvmtumxpy\",\"connectionErrorMessage\":\"jfuaxroqvqpilrgu\",\"transcriptLocation\":\"anlduwzorxsb\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-02-04T06:25:12Z\",\"sessionEndTime\":\"2021-04-10T14:35:27Z\",\"nodeName\":\"mxkqvf\",\"duration\":2889876698432401855,\"accessLevel\":\"Diagnostics\"},{\"sessionStartTime\":\"2021-02-18T05:36:17Z\",\"sessionEndTime\":\"2021-07-14T16:46:48Z\",\"nodeName\":\"wyvpj\",\"duration\":1357868514258880860,\"accessLevel\":\"DiagnosticsAndRepair\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Enhanced\"},\"reportedProperties\":{\"clusterName\":\"exkydfb\",\"clusterId\":\"javh\",\"clusterVersion\":\"rkjd\",\"nodes\":[{\"name\":\"liegftcvbi\",\"id\":81.57286,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"dnkefgm\",\"manufacturer\":\"hcebuvczldbglzo\",\"model\":\"baaq\",\"osName\":\"ekaj\",\"osVersion\":\"yzgsnorbjgmnz\",\"osDisplayVersion\":\"t\",\"serialNumber\":\"rxkhlob\",\"coreCount\":79.76163,\"memoryInGiB\":19.954985,\"lastLicensingTimestamp\":\"2021-05-11T18:13:33Z\",\"oemActivation\":\"Disabled\"}],\"lastUpdated\":\"2021-03-08T05:22:54Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Off\",\"supportedCapabilities\":[\"uosnuud\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"hyibdrqrswh\",\"oemActivation\":\"Disabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"y\",\"relyingPartyServiceEndpoint\":\"wtjoxz\",\"attestationServiceEndpoint\":\"wfqchvcz\"},\"trialDaysRemaining\":0.509882,\"billingModel\":\"nctagfyvrtpqpem\",\"registrationTimestamp\":\"2021-07-17T01:09:25Z\",\"lastSyncTimestamp\":\"2021-02-06T15:16:06Z\",\"lastBillingTimestamp\":\"2021-12-03T07:21:37Z\",\"serviceEndpoint\":\"dqhqyhwqwemv\",\"resourceProviderObjectId\":\"abckmzeoxinhgre\"},\"location\":\"twhlpuzjpce\",\"tags\":{\"phmsexroq\":\"zangprbfaxyxzlbc\",\"nfee\":\"ndktxfv\",\"bgnixxoww\":\"gpkrie\"},\"id\":\"kyfwnwpiwxeiicr\",\"name\":\"p\",\"type\":\"pk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Cluster response = manager.clusters() - .configureRemoteSupport("ezsdsuxheq", "gcruxspinym", - new RemoteSupportRequest().withProperties(new RemoteSupportRequestProperties() - .withExpirationTimestamp(OffsetDateTime.parse("2021-06-04T16:05:44Z")) - .withRemoteSupportType(RemoteSupportType.ENABLE)), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("twhlpuzjpce", response.location()); - Assertions.assertEquals("zangprbfaxyxzlbc", response.tags().get("phmsexroq")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.typeIdentityType()); - Assertions.assertEquals("p", response.cloudManagementEndpoint()); - Assertions.assertEquals("wp", response.aadClientId()); - Assertions.assertEquals("hgjtnhtukfaci", response.aadTenantId()); - Assertions.assertEquals("bfntumeezbxvq", response.aadApplicationObjectId()); - Assertions.assertEquals("nuvwcgasgomtmjzw", response.aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, - response.softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - response.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.ENHANCED, response.desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentityMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentityMockTests.java deleted file mode 100644 index 5250708e6eb3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentityMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersCreateIdentityMockTests { - @Test - public void testCreateIdentity() throws Exception { - String responseStr - = "{\"properties\":{\"aadClientId\":\"ledjcustbvtqigd\",\"aadTenantId\":\"vsgeafgf\",\"aadServicePrincipalObjectId\":\"ehxlzsxezppk\",\"aadApplicationObjectId\":\"aaeskyfjlpze\"}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterIdentityResponse response - = manager.clusters().createIdentity("lsyj", "eolctaebf", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateWithResponseMockTests.java deleted file mode 100644 index 89682cebd9f9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateWithResponseMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -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.LogCollectionProperties; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; -import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"33b9725c-39e1-4f46-ac71-c8fd624c348a\",\"tenantId\":\"d034c756-7750-4854-9603-17b0e99f4d16\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"t\":{\"principalId\":\"eefcd083-6f4e-47fa-b032-b9a90fa54c0c\",\"clientId\":\"2a17e21f-0f6b-4022-a4db-7d41b3644147\"},\"molpcqyde\":{\"principalId\":\"310e2ba7-6013-47c6-ad85-7425c0c5ef56\",\"clientId\":\"f6b9e9f9-5a95-474d-9145-ea615a11056d\"},\"skiczd\":{\"principalId\":\"12b2456b-7cec-460d-a09e-f95c482c74bc\",\"clientId\":\"1dd8b1fc-8657-4d94-83a0-57d309e7b6c1\"},\"eizikgqaboohxbms\":{\"principalId\":\"2400a659-6b39-4414-b6be-4e42028c832a\",\"clientId\":\"0e7d1bcc-41b3-40f4-85ee-9f737e366abc\"}}},\"properties\":{\"provisioningState\":\"Provisioning\",\"status\":\"Error\",\"connectivityStatus\":\"NotSpecified\",\"cloudId\":\"vewuyqaeoh\",\"cloudManagementEndpoint\":\"hgejkbvhhdaurgh\",\"aadClientId\":\"xaex\",\"aadTenantId\":\"hxjxjoezlqxrkdkn\",\"aadApplicationObjectId\":\"bekt\",\"aadServicePrincipalObjectId\":\"o\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-06-22T14:04:52Z\"},\"logCollectionProperties\":{\"fromDate\":\"2020-12-28T13:33:15Z\",\"toDate\":\"2020-12-24T14:15:46Z\",\"lastLogGenerated\":\"2021-02-10T19:11:34Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-10-27T12:48:20Z\",\"logEndTime\":\"2021-10-28T14:26:59Z\",\"timeCollected\":\"2021-11-07T15:02:52Z\",\"logSize\":6876179074329642977,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"bmdlqjbed\",\"endTimeCollected\":\"2021-04-13T18:01:59Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-05-30T19:18:21Z\",\"logEndTime\":\"2021-09-04T03:17:34Z\",\"timeCollected\":\"2021-05-22T06:53:40Z\",\"logSize\":1873661597049622764,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"xpkcdp\",\"endTimeCollected\":\"2021-05-29T14:33:46Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-07-13T06:57:28Z\",\"logEndTime\":\"2021-11-10T07:43:10Z\",\"timeCollected\":\"2021-05-14T16:09:24Z\",\"logSize\":2408862410974547227,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"jyg\",\"endTimeCollected\":\"2021-04-10T00:07:42Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-02-08T05:06:19Z\",\"logEndTime\":\"2021-11-10T12:39:45Z\",\"timeCollected\":\"2021-07-10T03:31:24Z\",\"logSize\":5940808250160111921,\"logCollectionStatus\":\"None\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"gvqcpdwj\",\"endTimeCollected\":\"2021-01-03T16:46:04Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"Diagnostics\",\"expirationTimeStamp\":\"2021-11-22T22:58:24Z\",\"remoteSupportType\":\"Enable\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"cdjhunhg\",\"state\":\"gawnrrnquo\",\"createdAt\":\"2021-04-17T12:36:08Z\",\"updatedAt\":\"2021-01-28T18:03:35Z\",\"connectionStatus\":\"eimseobfsxstcyil\",\"connectionErrorMessage\":\"zmmx\",\"transcriptLocation\":\"zlquzexo\"},{\"arcResourceId\":\"xebjvbz\",\"state\":\"zabwmvog\",\"createdAt\":\"2021-11-23T09:45:11Z\",\"updatedAt\":\"2021-02-22T10:33:03Z\",\"connectionStatus\":\"gi\",\"connectionErrorMessage\":\"wcehaqidoyzlt\",\"transcriptLocation\":\"omqo\"},{\"arcResourceId\":\"epiaeapfsergd\",\"state\":\"eqn\",\"createdAt\":\"2021-11-04T23:22:14Z\",\"updatedAt\":\"2021-04-16T16:17:47Z\",\"connectionStatus\":\"wbpqqncjubkhjoz\",\"connectionErrorMessage\":\"mcwmbup\",\"transcriptLocation\":\"qyvliqiipsejbsvs\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-07-02T19:45:24Z\",\"sessionEndTime\":\"2021-01-13T14:45:34Z\",\"nodeName\":\"dzydisnuep\",\"duration\":3643735732741373341,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-01-10T21:45:57Z\",\"sessionEndTime\":\"2021-09-29T18:06:51Z\",\"nodeName\":\"ttdiia\",\"duration\":6520305168269543676,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-01-09T11:54:07Z\",\"sessionEndTime\":\"2021-05-22T02:36:51Z\",\"nodeName\":\"ebiphryvcjwqwoq\",\"duration\":7314568991883609573,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-11-03T16:42:03Z\",\"sessionEndTime\":\"2021-03-06T14:36:39Z\",\"nodeName\":\"s\",\"duration\":4001919220570472502,\"accessLevel\":\"DiagnosticsAndRepair\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Enabled\",\"diagnosticLevel\":\"Off\"},\"reportedProperties\":{\"clusterName\":\"v\",\"clusterId\":\"khsusmmorf\",\"clusterVersion\":\"hwilz\",\"nodes\":[{\"name\":\"jmriprlkdneyttlr\",\"id\":87.365326,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"tpumltwjfluxynb\",\"manufacturer\":\"zlqywauyqn\",\"model\":\"khmocgjs\",\"osName\":\"ouarhwvixqqggljk\",\"osVersion\":\"sjrclrvtzq\",\"osDisplayVersion\":\"bctbhp\",\"serialNumber\":\"xpc\",\"coreCount\":40.743237,\"memoryInGiB\":3.5265923,\"lastLicensingTimestamp\":\"2021-08-27T15:37:44Z\",\"oemActivation\":\"Enabled\"},{\"name\":\"eq\",\"id\":4.6417713,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"wriuomzczfkic\",\"manufacturer\":\"vsaaxwsp\",\"model\":\"xikhfj\",\"osName\":\"bglcxkxgzzromvy\",\"osVersion\":\"sem\",\"osDisplayVersion\":\"esrfsvpinkzpatq\",\"serialNumber\":\"iswxspv\",\"coreCount\":71.246414,\"memoryInGiB\":56.06608,\"lastLicensingTimestamp\":\"2021-11-07T00:53:27Z\",\"oemActivation\":\"Disabled\"},{\"name\":\"pftesubzpvpvdy\",\"id\":81.08345,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"eu\",\"manufacturer\":\"fjb\",\"model\":\"zfxnxmlbmuos\",\"osName\":\"jmdihdcyyyzlw\",\"osVersion\":\"wzjnufz\",\"osDisplayVersion\":\"gmdq\",\"serialNumber\":\"nbzrtfte\",\"coreCount\":78.62227,\"memoryInGiB\":78.94032,\"lastLicensingTimestamp\":\"2021-08-16T22:24:01Z\",\"oemActivation\":\"Disabled\"},{\"name\":\"sxmtyjjvavdp\",\"id\":14.428884,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"titsf\",\"manufacturer\":\"fwanm\",\"model\":\"scauwazcgwdfr\",\"osName\":\"gyb\",\"osVersion\":\"ozokscvglli\",\"osDisplayVersion\":\"gbyfgwe\",\"serialNumber\":\"k\",\"coreCount\":40.628033,\"memoryInGiB\":7.843375,\"lastLicensingTimestamp\":\"2021-06-05T16:00:28Z\",\"oemActivation\":\"Enabled\"}],\"lastUpdated\":\"2021-03-20T16:40:18Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Off\",\"supportedCapabilities\":[\"skl\",\"e\",\"uugggzlfbgrd\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"srtmdylperpiltt\",\"oemActivation\":\"Disabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"fcm\",\"relyingPartyServiceEndpoint\":\"fbodetresrgvts\",\"attestationServiceEndpoint\":\"vftwaiv\"},\"trialDaysRemaining\":41.889103,\"billingModel\":\"evzgjypanh\",\"registrationTimestamp\":\"2021-08-20T09:01:24Z\",\"lastSyncTimestamp\":\"2021-10-11T22:17:45Z\",\"lastBillingTimestamp\":\"2021-06-06T18:24:53Z\",\"serviceEndpoint\":\"twwzjw\",\"resourceProviderObjectId\":\"nxlkfhglhrfoxqwe\"},\"location\":\"snhpcselqx\",\"tags\":{\"rl\":\"pqibukklv\",\"vfqbqna\":\"mlccmetjscz\"},\"id\":\"dsyenzsieuscpl\",\"name\":\"yvdgxlyzk\",\"type\":\"itdshezsvkolru\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Cluster response = manager.clusters() - .define("xxij") - .withRegion("do") - .withExistingResourceGroup("dm") - .withTags(mapOf("hmnulwem", "zfjjnnuxxrkk", "flu", "dcifrhjulrsulwz")) - .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("gyacwrasekwef", new UserAssignedIdentity(), "inwoqartwyxq", new UserAssignedIdentity())) - .withCloudManagementEndpoint("jezcjumvps") - .withAadClientId("ioyoiglkmiq") - .withAadTenantId("nracli") - .withAadApplicationObjectId("fqpspkladyd") - .withAadServicePrincipalObjectId("hautw") - .withSoftwareAssuranceProperties( - new SoftwareAssuranceProperties().withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)) - .withLogCollectionProperties(new LogCollectionProperties()) - .withRemoteSupportProperties(new RemoteSupportProperties()) - .withDesiredProperties( - new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.DISABLED) - .withDiagnosticLevel(DiagnosticLevel.ENHANCED)) - .create(); - - Assertions.assertEquals("snhpcselqx", response.location()); - Assertions.assertEquals("pqibukklv", response.tags().get("rl")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.typeIdentityType()); - Assertions.assertEquals("hgejkbvhhdaurgh", response.cloudManagementEndpoint()); - Assertions.assertEquals("xaex", response.aadClientId()); - Assertions.assertEquals("hxjxjoezlqxrkdkn", response.aadTenantId()); - Assertions.assertEquals("bekt", response.aadApplicationObjectId()); - Assertions.assertEquals("o", response.aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, - response.softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.ENABLED, - response.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.OFF, response.desiredProperties().diagnosticLevel()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteMockTests.java deleted file mode 100644 index 3f7fe5a56c5e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().delete("pj", "tlzm", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitMockTests.java deleted file mode 100644 index 3c8e8b5cadd6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitMockTests.java +++ /dev/null @@ -1,60 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersExtendSoftwareAssuranceBenefitMockTests { - @Test - public void testExtendSoftwareAssuranceBenefit() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"a1c0d1b5-155b-47db-8881-25e30ad3f49f\",\"tenantId\":\"95bad002-bc63-47a0-a9a6-9cc1b847edc9\",\"type\":\"None\",\"userAssignedIdentities\":{\"tmk\":{\"principalId\":\"f131e288-9ee8-45ea-a8dd-257b689bcc22\",\"clientId\":\"77ff6a15-2c07-43e8-bb08-06b9da4ac95e\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"DeploymentInProgress\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"xofqovchi\",\"cloudManagementEndpoint\":\"p\",\"aadClientId\":\"fidusztekxbyjgm\",\"aadTenantId\":\"e\",\"aadApplicationObjectId\":\"yihpqadagrh\",\"aadServicePrincipalObjectId\":\"icxdwyjfo\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-08-25T11:50:02Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-04-13T00:22:08Z\",\"toDate\":\"2021-08-21T21:09:47Z\",\"lastLogGenerated\":\"2021-11-22T15:26:05Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-07-09T20:14:47Z\",\"logEndTime\":\"2021-05-21T15:56:42Z\",\"timeCollected\":\"2021-05-26T18:15:22Z\",\"logSize\":4267812501058114274,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"lscrdpibfdyjduss\",\"endTimeCollected\":\"2021-06-08T13:08:24Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-09-05T00:37:54Z\",\"logEndTime\":\"2021-06-13T22:26:49Z\",\"timeCollected\":\"2021-11-26T05:02:46Z\",\"logSize\":7353880373342288472,\"logCollectionStatus\":\"InProgress\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"hbfrnuybfflj\",\"endTimeCollected\":\"2021-06-08T15:40:26Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"Diagnostics\",\"expirationTimeStamp\":\"2021-08-11T06:24:02Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"dusr\",\"state\":\"xfavsqwudoh\",\"createdAt\":\"2021-05-08T17:26:42Z\",\"updatedAt\":\"2021-11-14T01:49:53Z\",\"connectionStatus\":\"l\",\"connectionErrorMessage\":\"psimsf\",\"transcriptLocation\":\"pofqpmbhy\"},{\"arcResourceId\":\"sdrmmttjxophgerh\",\"state\":\"vgohtw\",\"createdAt\":\"2021-11-04T11:49:52Z\",\"updatedAt\":\"2020-12-30T16:03:16Z\",\"connectionStatus\":\"ixysf\",\"connectionErrorMessage\":\"msqywwwmhkruwae\",\"transcriptLocation\":\"ympmlqoin\"},{\"arcResourceId\":\"duewihapfj\",\"state\":\"knjdiqfliejhp\",\"createdAt\":\"2021-08-22T05:16:33Z\",\"updatedAt\":\"2021-08-23T08:00:50Z\",\"connectionStatus\":\"fsbw\",\"connectionErrorMessage\":\"ivbvzi\",\"transcriptLocation\":\"wxgoooxzpra\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2020-12-20T08:32:34Z\",\"sessionEndTime\":\"2021-05-19T19:16:08Z\",\"nodeName\":\"dgzigjsugswhgs\",\"duration\":5564706572038132947,\"accessLevel\":\"Diagnostics\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"ohzha\",\"clusterId\":\"v\",\"clusterVersion\":\"xbg\",\"nodes\":[{\"name\":\"rvqchoadhrsxqvzv\",\"id\":29.559118,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"fajglzrsubklrxhj\",\"manufacturer\":\"tcetjdv\",\"model\":\"dieq\",\"osName\":\"wa\",\"osVersion\":\"wdxvqzxoebwg\",\"osDisplayVersion\":\"bibanbau\",\"serialNumber\":\"tzvp\",\"coreCount\":51.154564,\"memoryInGiB\":78.0847,\"lastLicensingTimestamp\":\"2021-07-29T22:27:22Z\",\"oemActivation\":\"Disabled\"}],\"lastUpdated\":\"2021-11-26T19:20:25Z\",\"imdsAttestation\":\"Disabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"anbtttkgsu\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"swgkpjhboyikebh\",\"oemActivation\":\"Disabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"gwl\",\"relyingPartyServiceEndpoint\":\"hueoijyzcqyp\",\"attestationServiceEndpoint\":\"zufgs\"},\"trialDaysRemaining\":9.9179325,\"billingModel\":\"y\",\"registrationTimestamp\":\"2021-01-25T09:28:03Z\",\"lastSyncTimestamp\":\"2021-01-28T19:23:55Z\",\"lastBillingTimestamp\":\"2020-12-26T21:13:09Z\",\"serviceEndpoint\":\"pqa\",\"resourceProviderObjectId\":\"mkncfgybmxsnxo\"},\"location\":\"ullojk\",\"tags\":{\"wdjuxdbdljzgdy\":\"hg\",\"sgzlrqhb\":\"cvuq\"},\"id\":\"nq\",\"name\":\"gdxwbsfpyxx\",\"type\":\"jlf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Cluster response - = manager.clusters() - .extendSoftwareAssuranceBenefit("toyrplixlajml", "pq", - new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE)), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ullojk", response.location()); - Assertions.assertEquals("hg", response.tags().get("wdjuxdbdljzgdy")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.typeIdentityType()); - Assertions.assertEquals("p", response.cloudManagementEndpoint()); - Assertions.assertEquals("fidusztekxbyjgm", response.aadClientId()); - Assertions.assertEquals("e", response.aadTenantId()); - Assertions.assertEquals("yihpqadagrh", response.aadApplicationObjectId()); - Assertions.assertEquals("icxdwyjfo", response.aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, - response.softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - response.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, response.desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 8043d0ac3be4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"20c97887-7d42-478d-bd59-86e3635bc098\",\"tenantId\":\"41018299-5da9-4691-838d-d620dc82c209\",\"type\":\"None\",\"userAssignedIdentities\":{\"renxolriyehqbe\":{\"principalId\":\"e5683214-85f2-490d-82b4-adb498d43f9e\",\"clientId\":\"dc154b25-c23d-4ac2-8182-a30a792401f8\"},\"lhydwbdbfgrlpu\":{\"principalId\":\"ab7fc8d4-a0cd-4689-a13d-86d6f64037fb\",\"clientId\":\"8072ac09-5c9d-4780-b600-a8b96b8ec1cb\"}}},\"properties\":{\"provisioningState\":\"DisableInProgress\",\"status\":\"ConnectedRecently\",\"connectivityStatus\":\"NotConnectedRecently\",\"cloudId\":\"mpathubtah\",\"cloudManagementEndpoint\":\"an\",\"aadClientId\":\"wllbv\",\"aadTenantId\":\"zsffte\",\"aadApplicationObjectId\":\"us\",\"aadServicePrincipalObjectId\":\"tjtgravaqogfkb\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-07-22T12:18:14Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-07-02T19:24:21Z\",\"toDate\":\"2021-10-06T16:35:36Z\",\"lastLogGenerated\":\"2021-08-16T10:10:51Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-04-25T17:49:51Z\",\"logEndTime\":\"2021-05-25T10:22:53Z\",\"timeCollected\":\"2021-10-25T21:45:01Z\",\"logSize\":5671896095521184545,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"whczzqrhmng\",\"endTimeCollected\":\"2021-11-08T04:12:55Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-09-24T22:34:02Z\",\"logEndTime\":\"2021-10-02T13:30:34Z\",\"timeCollected\":\"2021-04-19T22:17:21Z\",\"logSize\":4983330695304354539,\"logCollectionStatus\":\"None\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"chl\",\"endTimeCollected\":\"2021-11-13T06:25:36Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-04-19T20:50:14Z\",\"logEndTime\":\"2021-01-20T19:39:16Z\",\"timeCollected\":\"2021-04-28T18:17:17Z\",\"logSize\":9142556233920666772,\"logCollectionStatus\":\"InProgress\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"xkbrfg\",\"endTimeCollected\":\"2021-09-01T06:36:17Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-04-12T17:31:30Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"qrxetfgcwvr\",\"state\":\"dqntycnawthv\",\"createdAt\":\"2021-07-10T21:24:04Z\",\"updatedAt\":\"2021-04-30T15:22:04Z\",\"connectionStatus\":\"yeamcmhudf\",\"connectionErrorMessage\":\"cehokw\",\"transcriptLocation\":\"qtwloes\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-04-22T13:34:52Z\",\"sessionEndTime\":\"2021-03-30T21:09:09Z\",\"nodeName\":\"yrukoi\",\"duration\":8271517726373471913,\"accessLevel\":\"Diagnostics\"},{\"sessionStartTime\":\"2021-03-26T19:42:44Z\",\"sessionEndTime\":\"2021-10-03T13:52:51Z\",\"nodeName\":\"pjlh\",\"duration\":3498524662642148931,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-08-26T17:06:24Z\",\"sessionEndTime\":\"2021-08-25T15:20:24Z\",\"nodeName\":\"qkkwhbgxvellvul\",\"duration\":258858222209929710,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-11-16T23:48:23Z\",\"sessionEndTime\":\"2021-12-05T20:30:24Z\",\"nodeName\":\"tvmcly\",\"duration\":7261970206067613622,\"accessLevel\":\"DiagnosticsAndRepair\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Enabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"fzuvrzmz\",\"clusterId\":\"zjqr\",\"clusterVersion\":\"pv\",\"nodes\":[{\"name\":\"foebo\",\"id\":12.669712,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"ohoqkpjtnqjilayw\",\"manufacturer\":\"cwm\",\"model\":\"yrilmhxdqaolf\",\"osName\":\"nkkbjpjvlywltmfw\",\"osVersion\":\"bjwhlwyjfnqzocr\",\"osDisplayVersion\":\"gczeuntgx\",\"serialNumber\":\"ca\",\"coreCount\":86.22356,\"memoryInGiB\":86.274,\"lastLicensingTimestamp\":\"2021-10-09T15:57:20Z\",\"oemActivation\":\"Enabled\"},{\"name\":\"vnyttzgi\",\"id\":13.321484,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"mgb\",\"manufacturer\":\"lqtxnrflkndrn\",\"model\":\"gfjo\",\"osName\":\"daqotwfh\",\"osVersion\":\"xwgsa\",\"osDisplayVersion\":\"c\",\"serialNumber\":\"owzafczu\",\"coreCount\":93.52678,\"memoryInGiB\":82.20888,\"lastLicensingTimestamp\":\"2021-04-06T10:07:56Z\",\"oemActivation\":\"Disabled\"}],\"lastUpdated\":\"2021-05-28T06:59:52Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"ti\",\"jnsxzajlnsjhwjuy\",\"xbxq\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"aytuadxkxeqbwp\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"ksarcdrnxsluvl\",\"relyingPartyServiceEndpoint\":\"adltxkpbqhvfdq\",\"attestationServiceEndpoint\":\"w\"},\"trialDaysRemaining\":89.20991,\"billingModel\":\"zdanojis\",\"registrationTimestamp\":\"2021-08-07T00:54:04Z\",\"lastSyncTimestamp\":\"2021-09-13T20:00:32Z\",\"lastBillingTimestamp\":\"2021-11-09T04:21:58Z\",\"serviceEndpoint\":\"tuz\",\"resourceProviderObjectId\":\"ctibpvbka\"},\"location\":\"xsmzygdf\",\"tags\":{\"so\":\"wseivmakxh\",\"bectvtfjmskdch\":\"ljuxl\",\"kzaz\":\"aiubavlzwpvgmfa\",\"rokzrthqetwpq\":\"gokedgjqafkm\"},\"id\":\"tvaoznqn\",\"name\":\"xiezeagmceit\",\"type\":\"ugedh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Cluster response = manager.clusters() - .getByResourceGroupWithResponse("bninjgazlsvbzfc", "uoeedwjcci", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xsmzygdf", response.location()); - Assertions.assertEquals("wseivmakxh", response.tags().get("so")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.typeIdentityType()); - Assertions.assertEquals("an", response.cloudManagementEndpoint()); - Assertions.assertEquals("wllbv", response.aadClientId()); - Assertions.assertEquals("zsffte", response.aadTenantId()); - Assertions.assertEquals("us", response.aadApplicationObjectId()); - Assertions.assertEquals("tjtgravaqogfkb", response.aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, - response.softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.ENABLED, - response.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, response.desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupMockTests.java deleted file mode 100644 index 81f876ee1831..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupMockTests.java +++ /dev/null @@ -1,56 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"76c19fd3-a8a2-428b-b8b1-71917b078139\",\"tenantId\":\"1cdc8460-6057-4ebd-a79a-967205711ca4\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"rzd\":{\"principalId\":\"067bebda-b856-44fc-8333-2e7f3c3b69f1\",\"clientId\":\"19f0d73b-a771-4146-ac92-8efc07257fd0\"},\"skzptjxulweucyr\":{\"principalId\":\"20aa2ea0-0072-41fb-b64b-c3378c37dc78\",\"clientId\":\"0308730e-140c-4fed-9ce5-69253b8df7a4\"}}},\"properties\":{\"provisioningState\":\"Moving\",\"status\":\"NotSpecified\",\"connectivityStatus\":\"NotSpecified\",\"cloudId\":\"gcj\",\"cloudManagementEndpoint\":\"n\",\"aadClientId\":\"hokamvfej\",\"aadTenantId\":\"nttmbq\",\"aadApplicationObjectId\":\"bzfivfok\",\"aadServicePrincipalObjectId\":\"sthhzagjfwy\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Enable\",\"lastUpdated\":\"2021-08-26T05:12:13Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-05-06T13:16:52Z\",\"toDate\":\"2021-07-25T18:07:22Z\",\"lastLogGenerated\":\"2021-07-26T22:31:28Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-01-21T21:09:44Z\",\"logEndTime\":\"2021-05-08T19:05:52Z\",\"timeCollected\":\"2021-12-08T12:43:53Z\",\"logSize\":6939845740099592279,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"gmihzpimcqr\",\"endTimeCollected\":\"2021-10-24T06:08:21Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-09-20T05:50:56Z\",\"logEndTime\":\"2021-08-05T10:06:57Z\",\"timeCollected\":\"2021-09-07T11:16:11Z\",\"logSize\":8016682642169928370,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"hzvqnsqktcmbjwz\",\"endTimeCollected\":\"2021-06-16T03:12:12Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-03-16T06:59:07Z\",\"logEndTime\":\"2021-09-17T07:57:52Z\",\"timeCollected\":\"2021-05-04T22:59:21Z\",\"logSize\":5868735635066716572,\"logCollectionStatus\":\"Failed\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"sqjcemqbmfuvqarw\",\"endTimeCollected\":\"2021-05-10T19:32:23Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-07-16T14:19:09Z\",\"logEndTime\":\"2021-10-06T23:58:53Z\",\"timeCollected\":\"2021-04-05T16:03:48Z\",\"logSize\":7848988341385216516,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"td\",\"endTimeCollected\":\"2021-09-26T12:41:41Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-02-10T07:45:24Z\",\"remoteSupportType\":\"Enable\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"dbtwaokbavly\",\"state\":\"aaknwfr\",\"createdAt\":\"2021-03-15T22:48:32Z\",\"updatedAt\":\"2021-12-08T22:25:30Z\",\"connectionStatus\":\"p\",\"connectionErrorMessage\":\"jdigatole\",\"transcriptLocation\":\"cbctnanqimwbzx\"},{\"arcResourceId\":\"cldpkawn\",\"state\":\"laimouxwk\",\"createdAt\":\"2021-11-27T17:21:56Z\",\"updatedAt\":\"2020-12-29T15:26:50Z\",\"connectionStatus\":\"fco\",\"connectionErrorMessage\":\"icziuswswjrkb\",\"transcriptLocation\":\"jhbtqq\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-05-28T05:56:34Z\",\"sessionEndTime\":\"2021-09-14T02:43Z\",\"nodeName\":\"wbivqvogfuyzwvbh\",\"duration\":1678698951923393252,\"accessLevel\":\"Diagnostics\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Disabled\",\"diagnosticLevel\":\"Off\"},\"reportedProperties\":{\"clusterName\":\"ikcdrdaasax\",\"clusterId\":\"bsmfkwiyjvz\",\"clusterVersion\":\"osrnawnvzmlnkoy\",\"nodes\":[{\"name\":\"jabjqqa\",\"id\":68.090454,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"udndoabhjxw\",\"manufacturer\":\"weuipmpvksmi\",\"model\":\"sqxtltclkrdpq\",\"osName\":\"hyrfrakkldgr\",\"osVersion\":\"fcmfcn\",\"osDisplayVersion\":\"ajqmat\",\"serialNumber\":\"tie\",\"coreCount\":25.239485,\"memoryInGiB\":32.494797,\"lastLicensingTimestamp\":\"2021-08-12T03:38:51Z\",\"oemActivation\":\"Disabled\"},{\"name\":\"bmtlpqagyno\",\"id\":50.55483,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"incryqxzx\",\"manufacturer\":\"zi\",\"model\":\"qimiymqr\",\"osName\":\"guhfupe\",\"osVersion\":\"svvoqsbpkflanfk\",\"osDisplayVersion\":\"syaowuzowp\",\"serialNumber\":\"hdkcprgu\",\"coreCount\":89.84289,\"memoryInGiB\":80.36083,\"lastLicensingTimestamp\":\"2021-02-01T20:30:38Z\",\"oemActivation\":\"Enabled\"}],\"lastUpdated\":\"2021-11-06T22:01:21Z\",\"imdsAttestation\":\"Enabled\",\"diagnosticLevel\":\"Enhanced\",\"supportedCapabilities\":[\"ud\",\"izcbfzmcrunfhiuc\",\"mfbcpaqktkrum\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"kyzbfvxovqkxiux\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"r\",\"relyingPartyServiceEndpoint\":\"yhlwcjsqg\",\"attestationServiceEndpoint\":\"hffbxrq\"},\"trialDaysRemaining\":41.991467,\"billingModel\":\"peuqlsdxeqztvxwm\",\"registrationTimestamp\":\"2021-08-04T10:36:28Z\",\"lastSyncTimestamp\":\"2021-03-28T03:59:41Z\",\"lastBillingTimestamp\":\"2021-05-02T23:28:12Z\",\"serviceEndpoint\":\"awwamecleqiouln\",\"resourceProviderObjectId\":\"zyoeo\"},\"location\":\"tollh\",\"tags\":{\"tzlnglxpn\":\"dm\",\"xigvjrktpgaeuk\":\"vyoanfbcswqagywv\"},\"id\":\"awohpmw\",\"name\":\"qnucs\",\"type\":\"lhsidsjtdl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.clusters().listByResourceGroup("vzilmhiv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tollh", response.iterator().next().location()); - Assertions.assertEquals("dm", response.iterator().next().tags().get("tzlnglxpn")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().typeIdentityType()); - Assertions.assertEquals("n", response.iterator().next().cloudManagementEndpoint()); - Assertions.assertEquals("hokamvfej", response.iterator().next().aadClientId()); - Assertions.assertEquals("nttmbq", response.iterator().next().aadTenantId()); - Assertions.assertEquals("bzfivfok", response.iterator().next().aadApplicationObjectId()); - Assertions.assertEquals("sthhzagjfwy", response.iterator().next().aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, - response.iterator().next().softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.DISABLED, - response.iterator().next().desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.OFF, response.iterator().next().desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListMockTests.java deleted file mode 100644 index 450062658cfc..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"45674139-81e8-42cb-98c6-c5e80982eaa1\",\"tenantId\":\"d4e93696-2a29-4264-9d56-d8aabe3a6c03\",\"type\":\"None\",\"userAssignedIdentities\":{\"exn\":{\"principalId\":\"29d84dc7-f4dc-4bd2-8bd0-e8b45f7923ed\",\"clientId\":\"028d5e46-5f8a-42b5-902c-7c54fb03f3c1\"}}},\"properties\":{\"provisioningState\":\"NotSpecified\",\"status\":\"ValidationSuccess\",\"connectivityStatus\":\"NotYetRegistered\",\"cloudId\":\"x\",\"cloudManagementEndpoint\":\"abjkdtfohfao\",\"aadClientId\":\"vkiwrsiwdyjqu\",\"aadTenantId\":\"kcrr\",\"aadApplicationObjectId\":\"eek\",\"aadServicePrincipalObjectId\":\"uehogdd\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Enabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-07-11T10:57:54Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-01-06T13:23:28Z\",\"toDate\":\"2021-12-03T23:32:55Z\",\"lastLogGenerated\":\"2021-12-09T15:31:40Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-04-15T12:16:51Z\",\"logEndTime\":\"2021-12-06T01:52:16Z\",\"timeCollected\":\"2021-03-18T17:00:36Z\",\"logSize\":5089706177234380966,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"vzt\",\"endTimeCollected\":\"2021-03-09T11:05:21Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-08-20T03:01:03Z\",\"logEndTime\":\"2021-08-25T12:23:03Z\",\"timeCollected\":\"2021-06-23T22:20:55Z\",\"logSize\":953608876389392721,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"fdde\",\"endTimeCollected\":\"2021-04-12T12:04:13Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-08-21T18:37:30Z\",\"logEndTime\":\"2020-12-25T11:31:23Z\",\"timeCollected\":\"2021-09-30T19:59:55Z\",\"logSize\":1480578356337551776,\"logCollectionStatus\":\"None\",\"logCollectionJobType\":\"Scheduled\",\"correlationId\":\"vmywhsbrcarycsjj\",\"endTimeCollected\":\"2021-08-11T01:22:34Z\",\"logCollectionError\":{}},{\"logStartTime\":\"2021-02-11T21:53:10Z\",\"logEndTime\":\"2021-06-09T21:20:06Z\",\"timeCollected\":\"2021-03-09T06:10:14Z\",\"logSize\":518379516929503139,\"logCollectionStatus\":\"Succeeded\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"rr\",\"endTimeCollected\":\"2021-09-17T17:40:03Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-09-05T10:47:38Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"pmfbfununmpzkr\",\"state\":\"yifkdschlzvf\",\"createdAt\":\"2021-03-30T02:21:42Z\",\"updatedAt\":\"2021-07-17T09:23:33Z\",\"connectionStatus\":\"jwg\",\"connectionErrorMessage\":\"nphbkgfyrt\",\"transcriptLocation\":\"mhmjpjs\"},{\"arcResourceId\":\"fp\",\"state\":\"wtyg\",\"createdAt\":\"2020-12-29T02:29:21Z\",\"updatedAt\":\"2021-05-16T09:34:56Z\",\"connectionStatus\":\"eharxifv\",\"connectionErrorMessage\":\"rxtmbpjptnvw\",\"transcriptLocation\":\"rsidqpxlbtpakf\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-07-21T20:48:18Z\",\"sessionEndTime\":\"2021-10-30T03:58:04Z\",\"nodeName\":\"kyutrymdwmfjhpyc\",\"duration\":1031808729537103141,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-08-24T21:59:02Z\",\"sessionEndTime\":\"2021-10-27T16:03:46Z\",\"nodeName\":\"drlefgnaavuag\",\"duration\":2102845836389182101,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2021-11-25T11:03:28Z\",\"sessionEndTime\":\"2021-04-08T19:55:23Z\",\"nodeName\":\"ctuhspfefyihduye\",\"duration\":4383132154985570043,\"accessLevel\":\"DiagnosticsAndRepair\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Enabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"suthhllnmwynefx\",\"clusterId\":\"lf\",\"clusterVersion\":\"atxtjrrlkmdskjhh\",\"nodes\":[{\"name\":\"jfoxcxscvslxl\",\"id\":4.2046843,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"kmyjmkxett\",\"manufacturer\":\"lojfkqidnqto\",\"model\":\"jhqxc\",\"osName\":\"htkbtnq\",\"osVersion\":\"ngldmbiipsn\",\"osDisplayVersion\":\"wl\",\"serialNumber\":\"znxhhllxr\",\"coreCount\":95.013336,\"memoryInGiB\":42.536728,\"lastLicensingTimestamp\":\"2021-06-26T09:38:10Z\",\"oemActivation\":\"Enabled\"},{\"name\":\"oajxeiygles\",\"id\":30.896765,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"ctrceqnkbr\",\"manufacturer\":\"obehdmljz\",\"model\":\"vume\",\"osName\":\"pbibn\",\"osVersion\":\"phepifexleqirc\",\"osDisplayVersion\":\"cly\",\"serialNumber\":\"gxvrpjl\",\"coreCount\":52.70626,\"memoryInGiB\":96.086845,\"lastLicensingTimestamp\":\"2021-03-27T15:26:01Z\",\"oemActivation\":\"Enabled\"},{\"name\":\"nettepdjxqeskoy\",\"id\":31.382202,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"ThirdParty\",\"ehcResourceId\":\"aewse\",\"manufacturer\":\"eskwxeg\",\"model\":\"hrg\",\"osName\":\"zhctm\",\"osVersion\":\"sghpbcbcpzarpze\",\"osDisplayVersion\":\"cdl\",\"serialNumber\":\"zmpypefcpczshnu\",\"coreCount\":42.157166,\"memoryInGiB\":49.67236,\"lastLicensingTimestamp\":\"2021-01-15T03:44:07Z\",\"oemActivation\":\"Disabled\"},{\"name\":\"huytuszx\",\"id\":23.604797,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"w\",\"manufacturer\":\"ukvzwydwttha\",\"model\":\"gkskjivbss\",\"osName\":\"jqf\",\"osVersion\":\"peexpgeumilhwuit\",\"osDisplayVersion\":\"exyionofninbd\",\"serialNumber\":\"s\",\"coreCount\":93.86298,\"memoryInGiB\":13.063449,\"lastLicensingTimestamp\":\"2021-03-08T05:21:03Z\",\"oemActivation\":\"Enabled\"}],\"lastUpdated\":\"2020-12-23T13:52:52Z\",\"imdsAttestation\":\"Disabled\",\"diagnosticLevel\":\"Basic\",\"supportedCapabilities\":[\"av\",\"zbcyksiv\",\"fogdrtbfcm\"],\"clusterType\":\"FirstParty\",\"manufacturer\":\"sjcwjjxsgmbawvif\",\"oemActivation\":\"Enabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"if\",\"relyingPartyServiceEndpoint\":\"cjxwkloozrvtxvcm\",\"attestationServiceEndpoint\":\"unlcpxxv\"},\"trialDaysRemaining\":25.181086,\"billingModel\":\"yngjgvrquvpygglp\",\"registrationTimestamp\":\"2021-10-12T15:29:26Z\",\"lastSyncTimestamp\":\"2021-05-19T05:39:03Z\",\"lastBillingTimestamp\":\"2021-03-23T16:26:12Z\",\"serviceEndpoint\":\"jt\",\"resourceProviderObjectId\":\"hxmfqryarvsxzqb\"},\"location\":\"cjkay\",\"tags\":{\"dubtlmj\":\"hz\",\"djxyxgbkkqvjcteo\":\"gblioskkfmkm\",\"pxvjnzd\":\"dlrslskk\",\"pcnab\":\"vocoj\"},\"id\":\"zf\",\"name\":\"nggy\",\"type\":\"e\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.clusters().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cjkay", response.iterator().next().location()); - Assertions.assertEquals("hz", response.iterator().next().tags().get("dubtlmj")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().typeIdentityType()); - Assertions.assertEquals("abjkdtfohfao", response.iterator().next().cloudManagementEndpoint()); - Assertions.assertEquals("vkiwrsiwdyjqu", response.iterator().next().aadClientId()); - Assertions.assertEquals("kcrr", response.iterator().next().aadTenantId()); - Assertions.assertEquals("eek", response.iterator().next().aadApplicationObjectId()); - Assertions.assertEquals("uehogdd", response.iterator().next().aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, - response.iterator().next().softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.ENABLED, - response.iterator().next().desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, - response.iterator().next().desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionMockTests.java deleted file mode 100644 index 99cdc27631a1..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ClustersTriggerLogCollectionMockTests.java +++ /dev/null @@ -1,60 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersTriggerLogCollectionMockTests { - @Test - public void testTriggerLogCollection() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"d80e69a3-e162-41ca-ba9b-1bc35c809346\",\"tenantId\":\"0b4ecb5a-f57e-4b25-8ba1-3cf0125add45\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ovribq\":{\"principalId\":\"3b79dc40-ae37-4122-b965-318fce2e012e\",\"clientId\":\"286a33a1-3b6a-478d-b5d7-459156b62e8c\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"NotYetRegistered\",\"connectivityStatus\":\"NotSpecified\",\"cloudId\":\"taznkcqwwxwjyof\",\"cloudManagementEndpoint\":\"hnkbtlwljssmctsn\",\"aadClientId\":\"kpwolg\",\"aadTenantId\":\"ubxbteogfgfiijr\",\"aadApplicationObjectId\":\"wlefksxqceazfpxg\",\"aadServicePrincipalObjectId\":\"qvzvlu\",\"softwareAssuranceProperties\":{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Enable\",\"lastUpdated\":\"2021-06-14T11:44:36Z\"},\"logCollectionProperties\":{\"fromDate\":\"2021-05-24T23:17:46Z\",\"toDate\":\"2021-03-03T06:35:43Z\",\"lastLogGenerated\":\"2021-07-14T22:22:26Z\",\"logCollectionSessionDetails\":[{\"logStartTime\":\"2021-08-12T03:41:34Z\",\"logEndTime\":\"2021-07-02T15:12:28Z\",\"timeCollected\":\"2021-08-22T05:41:09Z\",\"logSize\":7533324825716135469,\"logCollectionStatus\":\"InProgress\",\"logCollectionJobType\":\"OnDemand\",\"correlationId\":\"jdhsoy\",\"endTimeCollected\":\"2021-10-03T11:49:53Z\",\"logCollectionError\":{}}]},\"remoteSupportProperties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-11-12T07:02:25Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"boujstkfvv\",\"state\":\"hxcd\",\"createdAt\":\"2020-12-22T05:34:09Z\",\"updatedAt\":\"2021-03-14T15:19:04Z\",\"connectionStatus\":\"ygnxcgjtfrnqukt\",\"connectionErrorMessage\":\"nslnlrxsmyltrwnt\",\"transcriptLocation\":\"tbgwjdxwnazkur\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-06-12T09:43:04Z\",\"sessionEndTime\":\"2021-11-02T22:00:47Z\",\"nodeName\":\"hsetwwj\",\"duration\":3302215545380544215,\"accessLevel\":\"Diagnostics\"},{\"sessionStartTime\":\"2021-06-13T21:06:36Z\",\"sessionEndTime\":\"2021-04-07T08:12:26Z\",\"nodeName\":\"y\",\"duration\":6688942895771681924,\"accessLevel\":\"Diagnostics\"}]},\"desiredProperties\":{\"windowsServerSubscription\":\"Enabled\",\"diagnosticLevel\":\"Basic\"},\"reportedProperties\":{\"clusterName\":\"keys\",\"clusterId\":\"wfopazdazg\",\"clusterVersion\":\"qgpewqcfutmdpvoz\",\"nodes\":[{\"name\":\"bknlzcl\",\"id\":99.73375,\"windowsServerSubscription\":\"Enabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"ndc\",\"manufacturer\":\"dwzqauxzanhmkvfr\",\"model\":\"kudrbcpftx\",\"osName\":\"qyemebu\",\"osVersion\":\"ucmci\",\"osDisplayVersion\":\"nee\",\"serialNumber\":\"jauwcgxefnohaitr\",\"coreCount\":28.120434,\"memoryInGiB\":41.137814,\"lastLicensingTimestamp\":\"2021-03-02T16:05:57Z\",\"oemActivation\":\"Enabled\"},{\"name\":\"asmxubvfbngf\",\"id\":84.15061,\"windowsServerSubscription\":\"Disabled\",\"nodeType\":\"FirstParty\",\"ehcResourceId\":\"iylfmpztrau\",\"manufacturer\":\"vhl\",\"model\":\"culregpqt\",\"osName\":\"jhvrztnvgyshqrdg\",\"osVersion\":\"wmewjzlpyk\",\"osDisplayVersion\":\"azzwjcay\",\"serialNumber\":\"zrransyb\",\"coreCount\":75.015366,\"memoryInGiB\":26.378132,\"lastLicensingTimestamp\":\"2021-09-20T13:23:20Z\",\"oemActivation\":\"Enabled\"}],\"lastUpdated\":\"2021-03-21T23:43:17Z\",\"imdsAttestation\":\"Disabled\",\"diagnosticLevel\":\"Basic\",\"supportedCapabilities\":[\"fscjfn\",\"jwvuag\",\"qwtltngvmreupt\"],\"clusterType\":\"ThirdParty\",\"manufacturer\":\"m\",\"oemActivation\":\"Disabled\"},\"isolatedVmAttestationConfiguration\":{\"attestationResourceId\":\"olxf\",\"relyingPartyServiceEndpoint\":\"aghm\",\"attestationServiceEndpoint\":\"nwlslrcigtzjcvbx\"},\"trialDaysRemaining\":4.619074,\"billingModel\":\"snsso\",\"registrationTimestamp\":\"2021-08-20T00:22:26Z\",\"lastSyncTimestamp\":\"2021-09-29T19:56:37Z\",\"lastBillingTimestamp\":\"2021-02-25T19:52:15Z\",\"serviceEndpoint\":\"nievwffc\",\"resourceProviderObjectId\":\"yezslpu\"},\"location\":\"cbdsvalpnptwtrk\",\"tags\":{\"x\":\"azwu\",\"obfelhldiuhz\":\"qvn\"},\"id\":\"gqlmfaewzgi\",\"name\":\"djpxpqht\",\"type\":\"qhnmhk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Cluster response = manager.clusters() - .triggerLogCollection("ecominxojjluxxd", "ilz", - new LogCollectionRequest().withProperties( - new LogCollectionRequestProperties().withFromDate(OffsetDateTime.parse("2021-05-18T19:06:31Z")) - .withToDate(OffsetDateTime.parse("2021-08-12T20:15:45Z"))), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cbdsvalpnptwtrk", response.location()); - Assertions.assertEquals("azwu", response.tags().get("x")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.typeIdentityType()); - Assertions.assertEquals("hnkbtlwljssmctsn", response.cloudManagementEndpoint()); - Assertions.assertEquals("kpwolg", response.aadClientId()); - Assertions.assertEquals("ubxbteogfgfiijr", response.aadTenantId()); - Assertions.assertEquals("wlefksxqceazfpxg", response.aadApplicationObjectId()); - Assertions.assertEquals("qvzvlu", response.aadServicePrincipalObjectId()); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, - response.softwareAssuranceProperties().softwareAssuranceIntent()); - Assertions.assertEquals(WindowsServerSubscription.ENABLED, - response.desiredProperties().windowsServerSubscription()); - Assertions.assertEquals(DiagnosticLevel.BASIC, response.desiredProperties().diagnosticLevel()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DefaultExtensionDetailsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DefaultExtensionDetailsTests.java deleted file mode 100644 index 97441b65ae1c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DefaultExtensionDetailsTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; - -public final class DefaultExtensionDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefaultExtensionDetails model - = BinaryData.fromString("{\"category\":\"asy\",\"consentTime\":\"2021-10-21T22:29:11Z\"}") - .toObject(DefaultExtensionDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefaultExtensionDetails model = new DefaultExtensionDetails(); - model = BinaryData.fromObject(model).toObject(DefaultExtensionDetails.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentClusterTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentClusterTests.java deleted file mode 100644 index c3593478341b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentClusterTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentCluster; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentClusterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentCluster model = BinaryData.fromString( - "{\"name\":\"xyawj\",\"witnessType\":\"aq\",\"witnessPath\":\"lyjpk\",\"cloudAccountName\":\"dzyexznelixh\",\"azureServiceEndpoint\":\"ztfolhbnxk\"}") - .toObject(DeploymentCluster.class); - Assertions.assertEquals("xyawj", model.name()); - Assertions.assertEquals("aq", model.witnessType()); - Assertions.assertEquals("lyjpk", model.witnessPath()); - Assertions.assertEquals("dzyexznelixh", model.cloudAccountName()); - Assertions.assertEquals("ztfolhbnxk", model.azureServiceEndpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentCluster model = new DeploymentCluster().withName("xyawj") - .withWitnessType("aq") - .withWitnessPath("lyjpk") - .withCloudAccountName("dzyexznelixh") - .withAzureServiceEndpoint("ztfolhbnxk"); - model = BinaryData.fromObject(model).toObject(DeploymentCluster.class); - Assertions.assertEquals("xyawj", model.name()); - Assertions.assertEquals("aq", model.witnessType()); - Assertions.assertEquals("lyjpk", model.witnessPath()); - Assertions.assertEquals("dzyexznelixh", model.cloudAccountName()); - Assertions.assertEquals("ztfolhbnxk", model.azureServiceEndpoint()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingAdapterPropertyOverridesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingAdapterPropertyOverridesTests.java deleted file mode 100644 index 4dbe5a3ecddf..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingAdapterPropertyOverridesTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingAdapterPropertyOverridesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingAdapterPropertyOverrides model = BinaryData.fromString( - "{\"jumboPacket\":\"fikdowwqu\",\"networkDirect\":\"xzxcl\",\"networkDirectTechnology\":\"thhqzonosggbh\"}") - .toObject(DeploymentSettingAdapterPropertyOverrides.class); - Assertions.assertEquals("fikdowwqu", model.jumboPacket()); - Assertions.assertEquals("xzxcl", model.networkDirect()); - Assertions.assertEquals("thhqzonosggbh", model.networkDirectTechnology()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingAdapterPropertyOverrides model - = new DeploymentSettingAdapterPropertyOverrides().withJumboPacket("fikdowwqu") - .withNetworkDirect("xzxcl") - .withNetworkDirectTechnology("thhqzonosggbh"); - model = BinaryData.fromObject(model).toObject(DeploymentSettingAdapterPropertyOverrides.class); - Assertions.assertEquals("fikdowwqu", model.jumboPacket()); - Assertions.assertEquals("xzxcl", model.networkDirect()); - Assertions.assertEquals("thhqzonosggbh", model.networkDirectTechnology()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingHostNetworkTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingHostNetworkTests.java deleted file mode 100644 index 8a8e19f6c163..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingHostNetworkTests.java +++ /dev/null @@ -1,138 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingHostNetwork; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingIntents; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageAdapterIpInfo; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageNetworks; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides; -import com.azure.resourcemanager.azurestackhci.models.QosPolicyOverrides; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingHostNetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingHostNetwork model = BinaryData.fromString( - "{\"intents\":[{\"name\":\"xcto\",\"trafficType\":[\"kdmoi\",\"postmgrcfbunrm\"],\"adapter\":[\"hhkxbp\",\"jy\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"j\",\"loadBalancingAlgorithm\":\"gudivkrtswbxqz\"},\"overrideQosPolicy\":false,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"auvjfdxxivet\",\"priorityValue8021Action_SMB\":\"cqaqtdoqmcbx\",\"bandwidthPercentage_SMB\":\"vxysl\"},\"overrideAdapterProperty\":true,\"adapterPropertyOverrides\":{\"jumboPacket\":\"xoblytkbl\",\"networkDirect\":\"ewwwfbkrvrnsv\",\"networkDirectTechnology\":\"q\"}},{\"name\":\"hxcr\",\"trafficType\":[\"ovasrruvwbhsqfsu\",\"cgjbirxbp\"],\"adapter\":[\"rfbjf\",\"twss\",\"t\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"zbexilzznfqqnvw\",\"loadBalancingAlgorithm\":\"qtaruoujmkcjhwq\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"bnw\",\"priorityValue8021Action_SMB\":\"wgdrjervnaenqp\",\"bandwidthPercentage_SMB\":\"indoygmifthnzd\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"nayqi\",\"networkDirect\":\"nduhavhqlkthum\",\"networkDirectTechnology\":\"olbgycduiertgccy\"}}],\"storageNetworks\":[{\"name\":\"l\",\"networkAdapterName\":\"slqlfmmdn\",\"vlanId\":\"glzpswiydm\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"zdxss\",\"ipv4Address\":\"bzmnvdfznud\",\"subnetMask\":\"dvxzbncblylpst\"}]},{\"name\":\"hh\",\"networkAdapterName\":\"rzdzucerscdnt\",\"vlanId\":\"vfiwjmygtdss\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"mweriofzpy\",\"ipv4Address\":\"emwabnet\",\"subnetMask\":\"hszhedplvwiwu\"},{\"physicalNode\":\"wmbesldnkw\",\"ipv4Address\":\"pp\",\"subnetMask\":\"lcxog\"}]}],\"storageConnectivitySwitchless\":true,\"enableStorageAutoIp\":true}") - .toObject(DeploymentSettingHostNetwork.class); - Assertions.assertEquals("xcto", model.intents().get(0).name()); - Assertions.assertEquals("kdmoi", model.intents().get(0).trafficType().get(0)); - Assertions.assertEquals("hhkxbp", model.intents().get(0).adapter().get(0)); - Assertions.assertEquals(false, model.intents().get(0).overrideVirtualSwitchConfiguration()); - Assertions.assertEquals("j", model.intents().get(0).virtualSwitchConfigurationOverrides().enableIov()); - Assertions.assertEquals("gudivkrtswbxqz", - model.intents().get(0).virtualSwitchConfigurationOverrides().loadBalancingAlgorithm()); - Assertions.assertEquals(false, model.intents().get(0).overrideQosPolicy()); - Assertions.assertEquals("auvjfdxxivet", - model.intents().get(0).qosPolicyOverrides().priorityValue8021ActionCluster()); - Assertions.assertEquals("cqaqtdoqmcbx", - model.intents().get(0).qosPolicyOverrides().priorityValue8021ActionSmb()); - Assertions.assertEquals("vxysl", model.intents().get(0).qosPolicyOverrides().bandwidthPercentageSmb()); - Assertions.assertEquals(true, model.intents().get(0).overrideAdapterProperty()); - Assertions.assertEquals("xoblytkbl", model.intents().get(0).adapterPropertyOverrides().jumboPacket()); - Assertions.assertEquals("ewwwfbkrvrnsv", model.intents().get(0).adapterPropertyOverrides().networkDirect()); - Assertions.assertEquals("q", model.intents().get(0).adapterPropertyOverrides().networkDirectTechnology()); - Assertions.assertEquals("l", model.storageNetworks().get(0).name()); - Assertions.assertEquals("slqlfmmdn", model.storageNetworks().get(0).networkAdapterName()); - Assertions.assertEquals("glzpswiydm", model.storageNetworks().get(0).vlanId()); - Assertions.assertEquals("zdxss", model.storageNetworks().get(0).storageAdapterIpInfo().get(0).physicalNode()); - Assertions.assertEquals("bzmnvdfznud", - model.storageNetworks().get(0).storageAdapterIpInfo().get(0).ipv4Address()); - Assertions.assertEquals("dvxzbncblylpst", - model.storageNetworks().get(0).storageAdapterIpInfo().get(0).subnetMask()); - Assertions.assertEquals(true, model.storageConnectivitySwitchless()); - Assertions.assertEquals(true, model.enableStorageAutoIp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingHostNetwork model = new DeploymentSettingHostNetwork() - .withIntents(Arrays.asList( - new DeploymentSettingIntents().withName("xcto") - .withTrafficType(Arrays.asList("kdmoi", "postmgrcfbunrm")) - .withAdapter(Arrays.asList("hhkxbp", "jy")) - .withOverrideVirtualSwitchConfiguration(false) - .withVirtualSwitchConfigurationOverrides( - new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("j") - .withLoadBalancingAlgorithm("gudivkrtswbxqz")) - .withOverrideQosPolicy(false) - .withQosPolicyOverrides(new QosPolicyOverrides().withPriorityValue8021ActionCluster("auvjfdxxivet") - .withPriorityValue8021ActionSmb("cqaqtdoqmcbx") - .withBandwidthPercentageSmb("vxysl")) - .withOverrideAdapterProperty(true) - .withAdapterPropertyOverrides(new DeploymentSettingAdapterPropertyOverrides() - .withJumboPacket("xoblytkbl") - .withNetworkDirect("ewwwfbkrvrnsv") - .withNetworkDirectTechnology("q")), - new DeploymentSettingIntents().withName("hxcr") - .withTrafficType(Arrays.asList("ovasrruvwbhsqfsu", "cgjbirxbp")) - .withAdapter(Arrays.asList("rfbjf", "twss", "t")) - .withOverrideVirtualSwitchConfiguration(false) - .withVirtualSwitchConfigurationOverrides( - new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("zbexilzznfqqnvw") - .withLoadBalancingAlgorithm("qtaruoujmkcjhwq")) - .withOverrideQosPolicy(true) - .withQosPolicyOverrides(new QosPolicyOverrides().withPriorityValue8021ActionCluster("bnw") - .withPriorityValue8021ActionSmb("wgdrjervnaenqp") - .withBandwidthPercentageSmb("indoygmifthnzd")) - .withOverrideAdapterProperty(false) - .withAdapterPropertyOverrides( - new DeploymentSettingAdapterPropertyOverrides().withJumboPacket("nayqi") - .withNetworkDirect("nduhavhqlkthum") - .withNetworkDirectTechnology("olbgycduiertgccy")))) - .withStorageNetworks(Arrays.asList( - new DeploymentSettingStorageNetworks().withName("l") - .withNetworkAdapterName("slqlfmmdn") - .withVlanId("glzpswiydm") - .withStorageAdapterIpInfo( - Arrays.asList(new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("zdxss") - .withIpv4Address("bzmnvdfznud") - .withSubnetMask("dvxzbncblylpst"))), - new DeploymentSettingStorageNetworks().withName("hh") - .withNetworkAdapterName("rzdzucerscdnt") - .withVlanId("vfiwjmygtdss") - .withStorageAdapterIpInfo(Arrays.asList( - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("mweriofzpy") - .withIpv4Address("emwabnet") - .withSubnetMask("hszhedplvwiwu"), - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("wmbesldnkw") - .withIpv4Address("pp") - .withSubnetMask("lcxog"))))) - .withStorageConnectivitySwitchless(true) - .withEnableStorageAutoIp(true); - model = BinaryData.fromObject(model).toObject(DeploymentSettingHostNetwork.class); - Assertions.assertEquals("xcto", model.intents().get(0).name()); - Assertions.assertEquals("kdmoi", model.intents().get(0).trafficType().get(0)); - Assertions.assertEquals("hhkxbp", model.intents().get(0).adapter().get(0)); - Assertions.assertEquals(false, model.intents().get(0).overrideVirtualSwitchConfiguration()); - Assertions.assertEquals("j", model.intents().get(0).virtualSwitchConfigurationOverrides().enableIov()); - Assertions.assertEquals("gudivkrtswbxqz", - model.intents().get(0).virtualSwitchConfigurationOverrides().loadBalancingAlgorithm()); - Assertions.assertEquals(false, model.intents().get(0).overrideQosPolicy()); - Assertions.assertEquals("auvjfdxxivet", - model.intents().get(0).qosPolicyOverrides().priorityValue8021ActionCluster()); - Assertions.assertEquals("cqaqtdoqmcbx", - model.intents().get(0).qosPolicyOverrides().priorityValue8021ActionSmb()); - Assertions.assertEquals("vxysl", model.intents().get(0).qosPolicyOverrides().bandwidthPercentageSmb()); - Assertions.assertEquals(true, model.intents().get(0).overrideAdapterProperty()); - Assertions.assertEquals("xoblytkbl", model.intents().get(0).adapterPropertyOverrides().jumboPacket()); - Assertions.assertEquals("ewwwfbkrvrnsv", model.intents().get(0).adapterPropertyOverrides().networkDirect()); - Assertions.assertEquals("q", model.intents().get(0).adapterPropertyOverrides().networkDirectTechnology()); - Assertions.assertEquals("l", model.storageNetworks().get(0).name()); - Assertions.assertEquals("slqlfmmdn", model.storageNetworks().get(0).networkAdapterName()); - Assertions.assertEquals("glzpswiydm", model.storageNetworks().get(0).vlanId()); - Assertions.assertEquals("zdxss", model.storageNetworks().get(0).storageAdapterIpInfo().get(0).physicalNode()); - Assertions.assertEquals("bzmnvdfznud", - model.storageNetworks().get(0).storageAdapterIpInfo().get(0).ipv4Address()); - Assertions.assertEquals("dvxzbncblylpst", - model.storageNetworks().get(0).storageAdapterIpInfo().get(0).subnetMask()); - Assertions.assertEquals(true, model.storageConnectivitySwitchless()); - Assertions.assertEquals(true, model.enableStorageAutoIp()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingIntentsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingIntentsTests.java deleted file mode 100644 index b07fff0097ab..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingIntentsTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingIntents; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides; -import com.azure.resourcemanager.azurestackhci.models.QosPolicyOverrides; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingIntentsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingIntents model = BinaryData.fromString( - "{\"name\":\"m\",\"trafficType\":[\"kvmkqzeqq\",\"dltfz\",\"mhhv\"],\"adapter\":[\"r\"],\"overrideVirtualSwitchConfiguration\":true,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"obdagxtibqdxb\",\"loadBalancingAlgorithm\":\"akbogqxndlkzgxh\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"bpodxunkbebxm\",\"priorityValue8021Action_SMB\":\"yyntwl\",\"bandwidthPercentage_SMB\":\"qtkoievs\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"rlltmuwlauwzizx\",\"networkDirect\":\"pgcjefuzmuvp\",\"networkDirectTechnology\":\"tdum\"}}") - .toObject(DeploymentSettingIntents.class); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("kvmkqzeqq", model.trafficType().get(0)); - Assertions.assertEquals("r", model.adapter().get(0)); - Assertions.assertEquals(true, model.overrideVirtualSwitchConfiguration()); - Assertions.assertEquals("obdagxtibqdxb", model.virtualSwitchConfigurationOverrides().enableIov()); - Assertions.assertEquals("akbogqxndlkzgxh", - model.virtualSwitchConfigurationOverrides().loadBalancingAlgorithm()); - Assertions.assertEquals(true, model.overrideQosPolicy()); - Assertions.assertEquals("bpodxunkbebxm", model.qosPolicyOverrides().priorityValue8021ActionCluster()); - Assertions.assertEquals("yyntwl", model.qosPolicyOverrides().priorityValue8021ActionSmb()); - Assertions.assertEquals("qtkoievs", model.qosPolicyOverrides().bandwidthPercentageSmb()); - Assertions.assertEquals(false, model.overrideAdapterProperty()); - Assertions.assertEquals("rlltmuwlauwzizx", model.adapterPropertyOverrides().jumboPacket()); - Assertions.assertEquals("pgcjefuzmuvp", model.adapterPropertyOverrides().networkDirect()); - Assertions.assertEquals("tdum", model.adapterPropertyOverrides().networkDirectTechnology()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingIntents model = new DeploymentSettingIntents().withName("m") - .withTrafficType(Arrays.asList("kvmkqzeqq", "dltfz", "mhhv")) - .withAdapter(Arrays.asList("r")) - .withOverrideVirtualSwitchConfiguration(true) - .withVirtualSwitchConfigurationOverrides( - new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("obdagxtibqdxb") - .withLoadBalancingAlgorithm("akbogqxndlkzgxh")) - .withOverrideQosPolicy(true) - .withQosPolicyOverrides(new QosPolicyOverrides().withPriorityValue8021ActionCluster("bpodxunkbebxm") - .withPriorityValue8021ActionSmb("yyntwl") - .withBandwidthPercentageSmb("qtkoievs")) - .withOverrideAdapterProperty(false) - .withAdapterPropertyOverrides( - new DeploymentSettingAdapterPropertyOverrides().withJumboPacket("rlltmuwlauwzizx") - .withNetworkDirect("pgcjefuzmuvp") - .withNetworkDirectTechnology("tdum")); - model = BinaryData.fromObject(model).toObject(DeploymentSettingIntents.class); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("kvmkqzeqq", model.trafficType().get(0)); - Assertions.assertEquals("r", model.adapter().get(0)); - Assertions.assertEquals(true, model.overrideVirtualSwitchConfiguration()); - Assertions.assertEquals("obdagxtibqdxb", model.virtualSwitchConfigurationOverrides().enableIov()); - Assertions.assertEquals("akbogqxndlkzgxh", - model.virtualSwitchConfigurationOverrides().loadBalancingAlgorithm()); - Assertions.assertEquals(true, model.overrideQosPolicy()); - Assertions.assertEquals("bpodxunkbebxm", model.qosPolicyOverrides().priorityValue8021ActionCluster()); - Assertions.assertEquals("yyntwl", model.qosPolicyOverrides().priorityValue8021ActionSmb()); - Assertions.assertEquals("qtkoievs", model.qosPolicyOverrides().bandwidthPercentageSmb()); - Assertions.assertEquals(false, model.overrideAdapterProperty()); - Assertions.assertEquals("rlltmuwlauwzizx", model.adapterPropertyOverrides().jumboPacket()); - Assertions.assertEquals("pgcjefuzmuvp", model.adapterPropertyOverrides().networkDirect()); - Assertions.assertEquals("tdum", model.adapterPropertyOverrides().networkDirectTechnology()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingListResultTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingListResultTests.java deleted file mode 100644 index f918223e61ad..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingListResultTests.java +++ /dev/null @@ -1,52 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingInner; -import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration; -import com.azure.resourcemanager.azurestackhci.models.DeploymentData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingListResult; -import com.azure.resourcemanager.azurestackhci.models.OperationType; -import com.azure.resourcemanager.azurestackhci.models.ScaleUnits; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Disconnected\",\"arcNodeResourceIds\":[\"rzqlveu\",\"lupj\"],\"deploymentMode\":\"Deploy\",\"operationType\":\"ClusterUpgrade\",\"deploymentConfiguration\":{\"version\":\"obbc\",\"scaleUnits\":[{\"deploymentData\":{}},{\"deploymentData\":{}},{\"deploymentData\":{}},{\"deploymentData\":{}}]},\"reportedProperties\":{\"validationStatus\":{\"status\":\"jriplrbpbewtghf\",\"steps\":[{},{},{}]},\"deploymentStatus\":{\"status\":\"wxzvlvqhjkb\",\"steps\":[{},{},{},{}]}}},\"id\":\"t\",\"name\":\"mxiebw\",\"type\":\"aloayqcgwrtzju\"}],\"nextLink\":\"wyzmhtxon\"}") - .toObject(DeploymentSettingListResult.class); - Assertions.assertEquals("rzqlveu", model.value().get(0).arcNodeResourceIds().get(0)); - Assertions.assertEquals(DeploymentMode.DEPLOY, model.value().get(0).deploymentMode()); - Assertions.assertEquals(OperationType.CLUSTER_UPGRADE, model.value().get(0).operationType()); - Assertions.assertEquals("obbc", model.value().get(0).deploymentConfiguration().version()); - Assertions.assertEquals("wyzmhtxon", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingListResult model - = new DeploymentSettingListResult() - .withValue( - Arrays.asList(new DeploymentSettingInner().withArcNodeResourceIds(Arrays.asList("rzqlveu", "lupj")) - .withDeploymentMode(DeploymentMode.DEPLOY) - .withOperationType(OperationType.CLUSTER_UPGRADE) - .withDeploymentConfiguration(new DeploymentConfiguration().withVersion("obbc") - .withScaleUnits(Arrays.asList(new ScaleUnits().withDeploymentData(new DeploymentData()), - new ScaleUnits().withDeploymentData(new DeploymentData()), - new ScaleUnits().withDeploymentData(new DeploymentData()), - new ScaleUnits().withDeploymentData(new DeploymentData())))))) - .withNextLink("wyzmhtxon"); - model = BinaryData.fromObject(model).toObject(DeploymentSettingListResult.class); - Assertions.assertEquals("rzqlveu", model.value().get(0).arcNodeResourceIds().get(0)); - Assertions.assertEquals(DeploymentMode.DEPLOY, model.value().get(0).deploymentMode()); - Assertions.assertEquals(OperationType.CLUSTER_UPGRADE, model.value().get(0).operationType()); - Assertions.assertEquals("obbc", model.value().get(0).deploymentConfiguration().version()); - Assertions.assertEquals("wyzmhtxon", model.nextLink()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageAdapterIpInfoTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageAdapterIpInfoTests.java deleted file mode 100644 index 18abd42de276..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageAdapterIpInfoTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageAdapterIpInfo; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingStorageAdapterIpInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingStorageAdapterIpInfo model - = BinaryData.fromString("{\"physicalNode\":\"ld\",\"ipv4Address\":\"gx\",\"subnetMask\":\"rslpmutwuoeg\"}") - .toObject(DeploymentSettingStorageAdapterIpInfo.class); - Assertions.assertEquals("ld", model.physicalNode()); - Assertions.assertEquals("gx", model.ipv4Address()); - Assertions.assertEquals("rslpmutwuoeg", model.subnetMask()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingStorageAdapterIpInfo model = new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("ld") - .withIpv4Address("gx") - .withSubnetMask("rslpmutwuoeg"); - model = BinaryData.fromObject(model).toObject(DeploymentSettingStorageAdapterIpInfo.class); - Assertions.assertEquals("ld", model.physicalNode()); - Assertions.assertEquals("gx", model.ipv4Address()); - Assertions.assertEquals("rslpmutwuoeg", model.subnetMask()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageNetworksTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageNetworksTests.java deleted file mode 100644 index 17bfafd5d33f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingStorageNetworksTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageAdapterIpInfo; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageNetworks; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingStorageNetworksTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingStorageNetworks model = BinaryData.fromString( - "{\"name\":\"hfwdsjnkaljutiis\",\"networkAdapterName\":\"cffgdkzzewk\",\"vlanId\":\"hqcrailvpnpp\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"rwdmhdlxyjrxsa\",\"ipv4Address\":\"fcnihgwq\",\"subnetMask\":\"nedgfbc\"},{\"physicalNode\":\"cvqvpkeqdcv\",\"ipv4Address\":\"hvoodsotbobzd\",\"subnetMask\":\"cjwvn\"}]}") - .toObject(DeploymentSettingStorageNetworks.class); - Assertions.assertEquals("hfwdsjnkaljutiis", model.name()); - Assertions.assertEquals("cffgdkzzewk", model.networkAdapterName()); - Assertions.assertEquals("hqcrailvpnpp", model.vlanId()); - Assertions.assertEquals("rwdmhdlxyjrxsa", model.storageAdapterIpInfo().get(0).physicalNode()); - Assertions.assertEquals("fcnihgwq", model.storageAdapterIpInfo().get(0).ipv4Address()); - Assertions.assertEquals("nedgfbc", model.storageAdapterIpInfo().get(0).subnetMask()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingStorageNetworks model = new DeploymentSettingStorageNetworks().withName("hfwdsjnkaljutiis") - .withNetworkAdapterName("cffgdkzzewk") - .withVlanId("hqcrailvpnpp") - .withStorageAdapterIpInfo(Arrays.asList( - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("rwdmhdlxyjrxsa") - .withIpv4Address("fcnihgwq") - .withSubnetMask("nedgfbc"), - new DeploymentSettingStorageAdapterIpInfo().withPhysicalNode("cvqvpkeqdcv") - .withIpv4Address("hvoodsotbobzd") - .withSubnetMask("cjwvn"))); - model = BinaryData.fromObject(model).toObject(DeploymentSettingStorageNetworks.class); - Assertions.assertEquals("hfwdsjnkaljutiis", model.name()); - Assertions.assertEquals("cffgdkzzewk", model.networkAdapterName()); - Assertions.assertEquals("hqcrailvpnpp", model.vlanId()); - Assertions.assertEquals("rwdmhdlxyjrxsa", model.storageAdapterIpInfo().get(0).physicalNode()); - Assertions.assertEquals("fcnihgwq", model.storageAdapterIpInfo().get(0).ipv4Address()); - Assertions.assertEquals("nedgfbc", model.storageAdapterIpInfo().get(0).subnetMask()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingVirtualSwitchConfigurationOverridesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingVirtualSwitchConfigurationOverridesTests.java deleted file mode 100644 index 539884e50e75..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingVirtualSwitchConfigurationOverridesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSettingVirtualSwitchConfigurationOverridesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSettingVirtualSwitchConfigurationOverrides model - = BinaryData.fromString("{\"enableIov\":\"p\",\"loadBalancingAlgorithm\":\"ebmnzbtbhjpglk\"}") - .toObject(DeploymentSettingVirtualSwitchConfigurationOverrides.class); - Assertions.assertEquals("p", model.enableIov()); - Assertions.assertEquals("ebmnzbtbhjpglk", model.loadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSettingVirtualSwitchConfigurationOverrides model - = new DeploymentSettingVirtualSwitchConfigurationOverrides().withEnableIov("p") - .withLoadBalancingAlgorithm("ebmnzbtbhjpglk"); - model = BinaryData.fromObject(model).toObject(DeploymentSettingVirtualSwitchConfigurationOverrides.class); - Assertions.assertEquals("p", model.enableIov()); - Assertions.assertEquals("ebmnzbtbhjpglk", model.loadBalancingAlgorithm()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateMockTests.java deleted file mode 100644 index b3275e5ebbb2..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,56 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration; -import com.azure.resourcemanager.azurestackhci.models.DeploymentData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSetting; -import com.azure.resourcemanager.azurestackhci.models.OperationType; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerInfo; -import com.azure.resourcemanager.azurestackhci.models.ScaleUnits; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentSettingsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"arcNodeResourceIds\":[\"tclhuulriqbyokv\",\"gbzsxebrslt\",\"fyhcdjw\",\"uoard\"],\"deploymentMode\":\"Deploy\",\"operationType\":\"ClusterUpgrade\",\"deploymentConfiguration\":{\"version\":\"pufpbpgnrholhu\",\"scaleUnits\":[{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}}]},\"reportedProperties\":{\"validationStatus\":{\"status\":\"kysolsyjprxs\",\"steps\":[{},{}]},\"deploymentStatus\":{\"status\":\"cvhtbbzjhfvh\",\"steps\":[{}]}}},\"id\":\"xpcq\",\"name\":\"gihotjeco\",\"type\":\"mx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeploymentSetting response = manager.deploymentSettings() - .define("spugzfeuzjljmph") - .withExistingCluster("lndbeaqbkixv", "lwynpbbfqvzfj") - .withArcNodeResourceIds(Arrays.asList("o", "gj", "mi", "uydoccnx")) - .withDeploymentMode(DeploymentMode.DEPLOY) - .withOperationType(OperationType.CLUSTER_PROVISIONING) - .withDeploymentConfiguration(new DeploymentConfiguration().withVersion("bui") - .withScaleUnits(Arrays.asList(new ScaleUnits().withDeploymentData(new DeploymentData()) - .withSbePartnerInfo(new SbePartnerInfo())))) - .create(); - - Assertions.assertEquals("tclhuulriqbyokv", response.arcNodeResourceIds().get(0)); - Assertions.assertEquals(DeploymentMode.DEPLOY, response.deploymentMode()); - Assertions.assertEquals(OperationType.CLUSTER_UPGRADE, response.operationType()); - Assertions.assertEquals("pufpbpgnrholhu", response.deploymentConfiguration().version()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetWithResponseMockTests.java deleted file mode 100644 index cef67bc7e194..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSetting; -import com.azure.resourcemanager.azurestackhci.models.OperationType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Error\",\"arcNodeResourceIds\":[\"yies\",\"cwiqbuout\"],\"deploymentMode\":\"Validate\",\"operationType\":\"ClusterUpgrade\",\"deploymentConfiguration\":{\"version\":\"leofj\",\"scaleUnits\":[{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}}]},\"reportedProperties\":{\"validationStatus\":{\"status\":\"vdajfwn\",\"steps\":[{},{},{},{}]},\"deploymentStatus\":{\"status\":\"ciqgjjrlhiqlwixv\",\"steps\":[{}]}}},\"id\":\"g\",\"name\":\"xtndopgjttbasua\",\"type\":\"ap\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeploymentSetting response = manager.deploymentSettings() - .getWithResponse("mliqmvlb", "i", "eaqgrvgpomxpupd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("yies", response.arcNodeResourceIds().get(0)); - Assertions.assertEquals(DeploymentMode.VALIDATE, response.deploymentMode()); - Assertions.assertEquals(OperationType.CLUSTER_UPGRADE, response.operationType()); - Assertions.assertEquals("leofj", response.deploymentConfiguration().version()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersMockTests.java deleted file mode 100644 index 1052dd12c2a2..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; -import com.azure.resourcemanager.azurestackhci.models.DeploymentSetting; -import com.azure.resourcemanager.azurestackhci.models.OperationType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentSettingsListByClustersMockTests { - @Test - public void testListByClusters() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"arcNodeResourceIds\":[\"kipfsdyepf\",\"ocmbezacf\",\"ztgaz\"],\"deploymentMode\":\"Validate\",\"operationType\":\"ClusterUpgrade\",\"deploymentConfiguration\":{\"version\":\"gaaokctgkp\",\"scaleUnits\":[{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}},{\"deploymentData\":{},\"sbePartnerInfo\":{}}]},\"reportedProperties\":{\"validationStatus\":{\"status\":\"mffngdyfcixr\",\"steps\":[{},{},{},{}]},\"deploymentStatus\":{\"status\":\"hoe\",\"steps\":[{},{},{},{}]}}},\"id\":\"utgwrmkahpqha\",\"name\":\"yntacihnco\",\"type\":\"mip\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.deploymentSettings().listByClusters("jovmozsaye", "razwzlpzbt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kipfsdyepf", response.iterator().next().arcNodeResourceIds().get(0)); - Assertions.assertEquals(DeploymentMode.VALIDATE, response.iterator().next().deploymentMode()); - Assertions.assertEquals(OperationType.CLUSTER_UPGRADE, response.iterator().next().operationType()); - Assertions.assertEquals("gaaokctgkp", response.iterator().next().deploymentConfiguration().version()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentStepTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentStepTests.java deleted file mode 100644 index 5fd7e9a23ee1..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentStepTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeploymentStep; - -public final class DeploymentStepTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentStep model = BinaryData.fromString( - "{\"name\":\"hhahhxvrhmzkwpjg\",\"description\":\"spughftqsxhq\",\"fullStepIndex\":\"j\",\"startTimeUtc\":\"kndxdigrjgu\",\"endTimeUtc\":\"zdmsyqtfi\",\"status\":\"hbotzingamvppho\",\"steps\":[{\"name\":\"udphqamvdkfwyn\",\"description\":\"vtbvkayh\",\"fullStepIndex\":\"nvyq\",\"startTimeUtc\":\"tkzwpcnpwzc\",\"endTimeUtc\":\"esgvvsccyaj\",\"status\":\"qfhwyg\",\"steps\":[{\"name\":\"nk\",\"description\":\"usemdwzrmuhap\",\"fullStepIndex\":\"qdpsqxqvpsvu\",\"startTimeUtc\":\"mgccelvezrypq\",\"endTimeUtc\":\"feo\",\"status\":\"rqwky\",\"steps\":[{}],\"exception\":[\"pg\",\"edkowepbqpcrfk\",\"wccsnjvcdwxlpqek\"]},{\"name\":\"nkhtjsyingw\",\"description\":\"atmtdhtmdvy\",\"fullStepIndex\":\"ikdgszywkbir\",\"startTimeUtc\":\"uzhlhkjoqrv\",\"endTimeUtc\":\"aatjinrvgoupmfi\",\"status\":\"fggjioolvr\",\"steps\":[{},{}],\"exception\":[\"kkgll\",\"wjygvjayvblmhvk\",\"uhbxvvy\"]},{\"name\":\"s\",\"description\":\"byrqufeg\",\"fullStepIndex\":\"vwz\",\"startTimeUtc\":\"nhlmctlpdng\",\"endTimeUtc\":\"vgbmhr\",\"status\":\"kw\",\"steps\":[{},{},{}],\"exception\":[\"jvegrhbpnaixexcc\",\"dreaxh\",\"exdrrvqahqkg\",\"tpwijnh\"]}],\"exception\":[\"vfycxzb\",\"voowvr\",\"mtg\"]},{\"name\":\"ppyostronzmyhgf\",\"description\":\"nsxkmcwaekrrjr\",\"fullStepIndex\":\"fxtsgum\",\"startTimeUtc\":\"glikkxwslolb\",\"endTimeUtc\":\"vuzlm\",\"status\":\"elfk\",\"steps\":[{\"name\":\"crpw\",\"description\":\"eznoig\",\"fullStepIndex\":\"njwmwkpnbsazejj\",\"startTimeUtc\":\"kagfhsxtt\",\"endTimeUtc\":\"gzxnfaazpxdtnk\",\"status\":\"kqjjlwuenvrkp\",\"steps\":[{},{},{},{}],\"exception\":[\"bre\",\"qaaysjkixqt\"]},{\"name\":\"ttezlw\",\"description\":\"fiakpjpqqm\",\"fullStepIndex\":\"d\",\"startTimeUtc\":\"mmji\",\"endTimeUtc\":\"eozphv\",\"status\":\"uyqncygupkvipmd\",\"steps\":[{}],\"exception\":[\"upev\",\"hfstotxhojujbyp\"]},{\"name\":\"mc\",\"description\":\"hixbjxyfwnyl\",\"fullStepIndex\":\"ool\",\"startTimeUtc\":\"tpkiwkkbnujry\",\"endTimeUtc\":\"tylbfpncurdoiw\",\"status\":\"thtywub\",\"steps\":[{},{},{}],\"exception\":[\"wqknfdn\"]},{\"name\":\"jchrdgoihxumw\",\"description\":\"ond\",\"fullStepIndex\":\"luudfdlwggytsb\",\"startTimeUtc\":\"ovvtgseinqfiu\",\"endTimeUtc\":\"qknp\",\"status\":\"gnepttwqmsni\",\"steps\":[{}],\"exception\":[\"qnrojlpijnkrxfrd\",\"hcrat\",\"zzronasx\",\"ft\"]}],\"exception\":[\"yzhftwesgogczh\",\"nnxk\"]}],\"exception\":[\"nyhmossxkkgthr\",\"gh\",\"jbdhqxvc\"]}") - .toObject(DeploymentStep.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentStep model = new DeploymentStep(); - model = BinaryData.fromObject(model).toObject(DeploymentStep.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeviceConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeviceConfigurationTests.java deleted file mode 100644 index 3321cb116a64..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/DeviceConfigurationTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; -import com.azure.resourcemanager.azurestackhci.models.NicDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceConfiguration model = BinaryData.fromString( - "{\"nicDetails\":[{\"adapterName\":\"fhjirwgdnqzbrfk\",\"interfaceDescription\":\"zhzmtksjci\",\"componentId\":\"igsxcdgljplk\",\"driverVersion\":\"acht\",\"ip4Address\":\"flrytswfpfm\",\"subnetMask\":\"ycxnmskw\",\"defaultGateway\":\"jjyslurlps\",\"dnsServers\":[\"vpedwqslsrh\"],\"defaultIsolationId\":\"qvwwsko\"}],\"deviceMetadata\":\"cbrwi\"}") - .toObject(DeviceConfiguration.class); - Assertions.assertEquals("fhjirwgdnqzbrfk", model.nicDetails().get(0).adapterName()); - Assertions.assertEquals("zhzmtksjci", model.nicDetails().get(0).interfaceDescription()); - Assertions.assertEquals("igsxcdgljplk", model.nicDetails().get(0).componentId()); - Assertions.assertEquals("acht", model.nicDetails().get(0).driverVersion()); - Assertions.assertEquals("flrytswfpfm", model.nicDetails().get(0).ip4Address()); - Assertions.assertEquals("ycxnmskw", model.nicDetails().get(0).subnetMask()); - Assertions.assertEquals("jjyslurlps", model.nicDetails().get(0).defaultGateway()); - Assertions.assertEquals("vpedwqslsrh", model.nicDetails().get(0).dnsServers().get(0)); - Assertions.assertEquals("qvwwsko", model.nicDetails().get(0).defaultIsolationId()); - Assertions.assertEquals("cbrwi", model.deviceMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceConfiguration model - = new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("fhjirwgdnqzbrfk") - .withInterfaceDescription("zhzmtksjci") - .withComponentId("igsxcdgljplk") - .withDriverVersion("acht") - .withIp4Address("flrytswfpfm") - .withSubnetMask("ycxnmskw") - .withDefaultGateway("jjyslurlps") - .withDnsServers(Arrays.asList("vpedwqslsrh")) - .withDefaultIsolationId("qvwwsko"))).withDeviceMetadata("cbrwi"); - model = BinaryData.fromObject(model).toObject(DeviceConfiguration.class); - Assertions.assertEquals("fhjirwgdnqzbrfk", model.nicDetails().get(0).adapterName()); - Assertions.assertEquals("zhzmtksjci", model.nicDetails().get(0).interfaceDescription()); - Assertions.assertEquals("igsxcdgljplk", model.nicDetails().get(0).componentId()); - Assertions.assertEquals("acht", model.nicDetails().get(0).driverVersion()); - Assertions.assertEquals("flrytswfpfm", model.nicDetails().get(0).ip4Address()); - Assertions.assertEquals("ycxnmskw", model.nicDetails().get(0).subnetMask()); - Assertions.assertEquals("jjyslurlps", model.nicDetails().get(0).defaultGateway()); - Assertions.assertEquals("vpedwqslsrh", model.nicDetails().get(0).dnsServers().get(0)); - Assertions.assertEquals("qvwwsko", model.nicDetails().get(0).defaultIsolationId()); - Assertions.assertEquals("cbrwi", model.deviceMetadata()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceActionStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceActionStatusTests.java deleted file mode 100644 index ab6fef3daec3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceActionStatusTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.EceActionStatus; - -public final class EceActionStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EceActionStatus model = BinaryData.fromString( - "{\"status\":\"rtwaenuuzko\",\"steps\":[{\"name\":\"nrfdw\",\"description\":\"uhhziuiefozbhdm\",\"fullStepIndex\":\"l\",\"startTimeUtc\":\"qhoftrmaequiah\",\"endTimeUtc\":\"cslfaoqzpiyylha\",\"status\":\"swhccsphk\",\"steps\":[{\"name\":\"itqscywuggwoluhc\",\"description\":\"wem\",\"fullStepIndex\":\"i\",\"startTimeUtc\":\"brgz\",\"endTimeUtc\":\"msweypqwdxggicc\",\"status\":\"xqhuexm\",\"steps\":[{},{},{}],\"exception\":[\"tvlz\",\"wem\",\"zrncsdt\",\"lusiy\"]},{\"name\":\"sfgytguslfead\",\"description\":\"gq\",\"fullStepIndex\":\"yhejhzisxgfp\",\"startTimeUtc\":\"olppvksrpqvujz\",\"endTimeUtc\":\"ehtwdwrft\",\"status\":\"iby\",\"steps\":[{}],\"exception\":[\"h\",\"hfwpracstwit\",\"khevxccedc\",\"nmdyodnwzxl\"]},{\"name\":\"cvnhltiugc\",\"description\":\"avvwxqi\",\"fullStepIndex\":\"qunyowxwlmdjr\",\"startTimeUtc\":\"fgbvfvpdbo\",\"endTimeUtc\":\"cizsjqlhkrribdei\",\"status\":\"ipqkghvxndzwm\",\"steps\":[{},{}],\"exception\":[\"jpjorwkqnyhgb\",\"j\"]}],\"exception\":[\"vfxzsjab\",\"bsystawfsdjpvk\",\"p\",\"jxbkzbzkdvn\"]},{\"name\":\"abudurgk\",\"description\":\"mokzhjjklf\",\"fullStepIndex\":\"mouwqlgzrfzeey\",\"startTimeUtc\":\"izikayuhq\",\"endTimeUtc\":\"jbsybbqw\",\"status\":\"t\",\"steps\":[{\"name\":\"fp\",\"description\":\"mpipaslthaqfxs\",\"fullStepIndex\":\"wutwbdsre\",\"startTimeUtc\":\"drhneuyow\",\"endTimeUtc\":\"d\",\"status\":\"t\",\"steps\":[{}],\"exception\":[\"rcgp\",\"kpzi\",\"ejzanlfz\"]},{\"name\":\"av\",\"description\":\"bzonok\",\"fullStepIndex\":\"rjqc\",\"startTimeUtc\":\"gzpfrla\",\"endTimeUtc\":\"zrnw\",\"status\":\"indfpwpjyl\",\"steps\":[{},{},{},{}],\"exception\":[\"flsjc\"]}],\"exception\":[\"zfjvfbgofe\",\"jagrqmqhldvr\",\"iiojnal\",\"hfkvtvsexsowuel\"]}]}") - .toObject(EceActionStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EceActionStatus model = new EceActionStatus(); - model = BinaryData.fromObject(model).toObject(EceActionStatus.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceReportedPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceReportedPropertiesTests.java deleted file mode 100644 index 541200b06bb2..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EceReportedPropertiesTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.EceReportedProperties; - -public final class EceReportedPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EceReportedProperties model = BinaryData.fromString( - "{\"validationStatus\":{\"status\":\"kcnqxwbpo\",\"steps\":[{\"name\":\"iujwa\",\"description\":\"ipqiiobyuqerpq\",\"fullStepIndex\":\"qwcciuqg\",\"startTimeUtc\":\"butauvfb\",\"endTimeUtc\":\"uwhhmhykojoxafn\",\"status\":\"lpichk\",\"steps\":[{\"name\":\"cdyhbpkkpwdreqn\",\"description\":\"vq\",\"fullStepIndex\":\"vljxywsu\",\"startTimeUtc\":\"yrs\",\"endTimeUtc\":\"sytgadgvraea\",\"status\":\"e\",\"steps\":[{}],\"exception\":[\"rwlqu\",\"ijfqkacewiipfp\",\"bjibwwiftohq\",\"vpuvks\"]},{\"name\":\"lsa\",\"description\":\"ynfs\",\"fullStepIndex\":\"ljphuopxodl\",\"startTimeUtc\":\"ynt\",\"endTimeUtc\":\"zihleosjswsr\",\"status\":\"lyzrpzbchckqqzqi\",\"steps\":[{},{}],\"exception\":[\"uiizynke\",\"yatrwy\",\"q\",\"ibzyhwitsmyp\"]},{\"name\":\"npcdpumnzgm\",\"description\":\"nmabik\",\"fullStepIndex\":\"orgjhxbldt\",\"startTimeUtc\":\"wrlkdmtn\",\"endTimeUtc\":\"ok\",\"status\":\"llxdyhgs\",\"steps\":[{},{},{}],\"exception\":[\"jlt\",\"tbnnha\",\"oocrkvcikhnv\",\"amqgxqquezikyw\"]},{\"name\":\"xkalla\",\"description\":\"elwuipi\",\"fullStepIndex\":\"jzkzi\",\"startTimeUtc\":\"vvcnayr\",\"endTimeUtc\":\"rnxxmueed\",\"status\":\"rdvstkwqqtch\",\"steps\":[{},{},{}],\"exception\":[\"mtdaa\",\"gdv\",\"vgpiohgwxrt\",\"udxepxgyqagv\"]}],\"exception\":[\"npkukghimdblx\",\"wi\",\"fnjhfjxwmszkkfo\",\"rey\"]},{\"name\":\"zi\",\"description\":\"jawneaiv\",\"fullStepIndex\":\"czelpcirel\",\"startTimeUtc\":\"eae\",\"endTimeUtc\":\"abfatkl\",\"status\":\"xbjhwuaanozjosph\",\"steps\":[{\"name\":\"pjrvxagl\",\"description\":\"imjwosyt\",\"fullStepIndex\":\"tcs\",\"startTimeUtc\":\"cktqumiekkezzi\",\"endTimeUtc\":\"ly\",\"status\":\"hdgqggeb\",\"steps\":[{}],\"exception\":[\"aeqidbqfatpxll\"]},{\"name\":\"cyjmoadsuvarmy\",\"description\":\"mjsjqb\",\"fullStepIndex\":\"hyxxrwlycoduhpk\",\"startTimeUtc\":\"gymare\",\"endTimeUtc\":\"ajxq\",\"status\":\"jhkycub\",\"steps\":[{},{},{},{}],\"exception\":[\"sofwqmzqalkrmnji\",\"pxacqqudfn\",\"yxbaaabjyvayf\"]}],\"exception\":[\"rzrtuzqogsex\"]}]},\"deploymentStatus\":{\"status\":\"fdnw\",\"steps\":[{\"name\":\"wzsyyceuzs\",\"description\":\"bjudpfrxtrthzv\",\"fullStepIndex\":\"tdwkqbrq\",\"startTimeUtc\":\"paxh\",\"endTimeUtc\":\"iilivpdtiirqtd\",\"status\":\"axoruzfgsquy\",\"steps\":[{\"name\":\"xleptramx\",\"description\":\"zwl\",\"fullStepIndex\":\"wxuqlcvydypatdoo\",\"startTimeUtc\":\"jkniodko\",\"endTimeUtc\":\"bw\",\"status\":\"jhemms\",\"steps\":[{},{}],\"exception\":[\"rodtjinfwjlfl\"]},{\"name\":\"acjvefkd\",\"description\":\"oakggkfpag\",\"fullStepIndex\":\"wpu\",\"startTimeUtc\":\"qblylsyxkqj\",\"endTimeUtc\":\"jervtia\",\"status\":\"sdszue\",\"steps\":[{},{}],\"exception\":[\"kfzbeyvpnqicvi\",\"v\"]}],\"exception\":[\"xdxr\",\"uukzclewyhmlw\",\"aztz\"]},{\"name\":\"fn\",\"description\":\"kwyfzqwhxxbuyqax\",\"fullStepIndex\":\"eqz\",\"startTimeUtc\":\"priolx\",\"endTimeUtc\":\"jaltolmnc\",\"status\":\"obqwcsdbnwdcfh\",\"steps\":[{\"name\":\"pfuvglsbjjca\",\"description\":\"xbvtvudu\",\"fullStepIndex\":\"cormr\",\"startTimeUtc\":\"qtvcofudflvkgj\",\"endTimeUtc\":\"gdknnqv\",\"status\":\"znqntoru\",\"steps\":[{},{},{},{}],\"exception\":[\"hmk\"]},{\"name\":\"grauwjuetaebur\",\"description\":\"dmovsm\",\"fullStepIndex\":\"xwabmqoe\",\"startTimeUtc\":\"ifrvtpu\",\"endTimeUtc\":\"jmqlgkfb\",\"status\":\"doaon\",\"steps\":[{},{}],\"exception\":[\"tujitcjedft\",\"waezkojvd\"]},{\"name\":\"zfoqouicybxar\",\"description\":\"szufoxciqopidoa\",\"fullStepIndex\":\"iodhkhazxkhnz\",\"startTimeUtc\":\"nlwntoe\",\"endTimeUtc\":\"kdwbwhkszz\",\"status\":\"rvexztvb\",\"steps\":[{},{},{}],\"exception\":[\"ra\"]},{\"name\":\"zkoowtlmnguxawqa\",\"description\":\"syuuximerq\",\"fullStepIndex\":\"bw\",\"startTimeUtc\":\"nkbykutwpfhp\",\"endTimeUtc\":\"m\",\"status\":\"skdsnfdsdoakg\",\"steps\":[{}],\"exception\":[\"kzevdlhewpusds\"]}],\"exception\":[\"vogvbbejdcngqqmo\",\"kufgmj\",\"rwr\"]}]}}") - .toObject(EceReportedProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EceReportedProperties model = new EceReportedProperties(); - model = BinaryData.fromObject(model).toObject(EceReportedProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceInnerTests.java deleted file mode 100644 index ef33536bf4bd..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceInnerTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; - -public final class EdgeDeviceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EdgeDeviceInner model = BinaryData - .fromString( - "{\"kind\":\"EdgeDevice\",\"id\":\"opqgikyzirtxdyux\",\"name\":\"ejnt\",\"type\":\"sewgioilqukr\"}") - .toObject(EdgeDeviceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EdgeDeviceInner model = new EdgeDeviceInner(); - model = BinaryData.fromObject(model).toObject(EdgeDeviceInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceListResultTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceListResultTests.java deleted file mode 100644 index af9b0722c657..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDeviceListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; -import com.azure.resourcemanager.azurestackhci.models.EdgeDeviceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EdgeDeviceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EdgeDeviceListResult model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"EdgeDevice\",\"id\":\"rpdsof\",\"name\":\"shrnsvbuswdvz\",\"type\":\"ybycnunvj\"}],\"nextLink\":\"tkfa\"}") - .toObject(EdgeDeviceListResult.class); - Assertions.assertEquals("tkfa", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EdgeDeviceListResult model - = new EdgeDeviceListResult().withValue(Arrays.asList(new EdgeDeviceInner())).withNextLink("tkfa"); - model = BinaryData.fromObject(model).toObject(EdgeDeviceListResult.class); - Assertions.assertEquals("tkfa", model.nextLink()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicePropertiesTests.java deleted file mode 100644 index 1370e13ec6a0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicePropertiesTests.java +++ /dev/null @@ -1,56 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; -import com.azure.resourcemanager.azurestackhci.models.EdgeDeviceProperties; -import com.azure.resourcemanager.azurestackhci.models.NicDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EdgeDevicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EdgeDeviceProperties model = BinaryData.fromString( - "{\"deviceConfiguration\":{\"nicDetails\":[{\"adapterName\":\"gddeimaw\",\"interfaceDescription\":\"vgkk\",\"componentId\":\"ui\",\"driverVersion\":\"cjc\",\"ip4Address\":\"tbw\",\"subnetMask\":\"sqowxwc\",\"defaultGateway\":\"likytwvczcswka\",\"dnsServers\":[\"jyfdvlv\",\"b\",\"rnfxtgddp\",\"th\"],\"defaultIsolationId\":\"n\"}],\"deviceMetadata\":\"aoyankcoeqswa\"},\"provisioningState\":\"InProgress\"}") - .toObject(EdgeDeviceProperties.class); - Assertions.assertEquals("gddeimaw", model.deviceConfiguration().nicDetails().get(0).adapterName()); - Assertions.assertEquals("vgkk", model.deviceConfiguration().nicDetails().get(0).interfaceDescription()); - Assertions.assertEquals("ui", model.deviceConfiguration().nicDetails().get(0).componentId()); - Assertions.assertEquals("cjc", model.deviceConfiguration().nicDetails().get(0).driverVersion()); - Assertions.assertEquals("tbw", model.deviceConfiguration().nicDetails().get(0).ip4Address()); - Assertions.assertEquals("sqowxwc", model.deviceConfiguration().nicDetails().get(0).subnetMask()); - Assertions.assertEquals("likytwvczcswka", model.deviceConfiguration().nicDetails().get(0).defaultGateway()); - Assertions.assertEquals("jyfdvlv", model.deviceConfiguration().nicDetails().get(0).dnsServers().get(0)); - Assertions.assertEquals("n", model.deviceConfiguration().nicDetails().get(0).defaultIsolationId()); - Assertions.assertEquals("aoyankcoeqswa", model.deviceConfiguration().deviceMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EdgeDeviceProperties model = new EdgeDeviceProperties().withDeviceConfiguration( - new DeviceConfiguration().withNicDetails(Arrays.asList(new NicDetail().withAdapterName("gddeimaw") - .withInterfaceDescription("vgkk") - .withComponentId("ui") - .withDriverVersion("cjc") - .withIp4Address("tbw") - .withSubnetMask("sqowxwc") - .withDefaultGateway("likytwvczcswka") - .withDnsServers(Arrays.asList("jyfdvlv", "b", "rnfxtgddp", "th")) - .withDefaultIsolationId("n"))).withDeviceMetadata("aoyankcoeqswa")); - model = BinaryData.fromObject(model).toObject(EdgeDeviceProperties.class); - Assertions.assertEquals("gddeimaw", model.deviceConfiguration().nicDetails().get(0).adapterName()); - Assertions.assertEquals("vgkk", model.deviceConfiguration().nicDetails().get(0).interfaceDescription()); - Assertions.assertEquals("ui", model.deviceConfiguration().nicDetails().get(0).componentId()); - Assertions.assertEquals("cjc", model.deviceConfiguration().nicDetails().get(0).driverVersion()); - Assertions.assertEquals("tbw", model.deviceConfiguration().nicDetails().get(0).ip4Address()); - Assertions.assertEquals("sqowxwc", model.deviceConfiguration().nicDetails().get(0).subnetMask()); - Assertions.assertEquals("likytwvczcswka", model.deviceConfiguration().nicDetails().get(0).defaultGateway()); - Assertions.assertEquals("jyfdvlv", model.deviceConfiguration().nicDetails().get(0).dnsServers().get(0)); - Assertions.assertEquals("n", model.deviceConfiguration().nicDetails().get(0).defaultIsolationId()); - Assertions.assertEquals("aoyankcoeqswa", model.deviceConfiguration().deviceMetadata()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateMockTests.java deleted file mode 100644 index 377aeeb6aba6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; -import com.azure.resourcemanager.azurestackhci.models.EdgeDevice; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EdgeDevicesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr = "{\"kind\":\"EdgeDevice\",\"id\":\"kqmt\",\"name\":\"apeqiscrpil\",\"type\":\"ftr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EdgeDevice response = manager.edgeDevices() - .createOrUpdate("qfkyfhiwvjaqu", "by", new EdgeDeviceInner(), com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetWithResponseMockTests.java deleted file mode 100644 index 6d89e5c82b11..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.EdgeDevice; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EdgeDevicesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr = "{\"kind\":\"EdgeDevice\",\"id\":\"kxxi\",\"name\":\"wgxql\",\"type\":\"ekotjgxi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EdgeDevice response = manager.edgeDevices() - .getWithResponse("ersejeg", "rkjguwrjmwvvbt", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListMockTests.java deleted file mode 100644 index 4180775e402b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.EdgeDevice; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EdgeDevicesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"kind\":\"EdgeDevice\",\"id\":\"derltfokyksyim\",\"name\":\"ccgrvkcxzznn\",\"type\":\"i\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.edgeDevices().list("vlrrskapbxwieexu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateMockTests.java deleted file mode 100644 index 0d892d1f3149..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; -import com.azure.resourcemanager.azurestackhci.models.ValidateResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EdgeDevicesValidateMockTests { - @Test - public void testValidate() throws Exception { - String responseStr = "{\"status\":\"ybnxgztlcgc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateResponse response = manager.edgeDevices() - .validate("rejdaahuqim", "dahlfxlmuifmuadj", - new ValidateRequest().withEdgeDeviceIds(Arrays.asList("snc")).withAdditionalInfo("iioshjgcz"), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionListTests.java deleted file mode 100644 index 3067db135276..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionListTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionList; - -public final class ExtensionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"PartiallySucceeded\",\"extensionParameters\":{\"forceUpdateTag\":\"zdgiruj\",\"publisher\":\"bomvzzbtdcqv\",\"type\":\"iyujviylwdshfs\",\"typeHandlerVersion\":\"rbgyefry\",\"autoUpgradeMinorVersion\":false,\"settings\":\"dataojfmwnco\",\"protectedSettings\":\"datarfh\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Moving\",\"perNodeExtensionDetails\":[{\"name\":\"oftpipiwycz\",\"extension\":\"xacpqjli\",\"typeHandlerVersion\":\"yuspskas\",\"state\":\"Failed\",\"instanceView\":{}},{\"name\":\"wdgzxulucv\",\"extension\":\"mrsreuzvxurisjnh\",\"typeHandlerVersion\":\"txifqj\",\"state\":\"PartiallySucceeded\",\"instanceView\":{}},{\"name\":\"hu\",\"extension\":\"wp\",\"typeHandlerVersion\":\"sutrgjup\",\"state\":\"Disconnected\",\"instanceView\":{}},{\"name\":\"woqhihe\",\"extension\":\"g\",\"typeHandlerVersion\":\"pnfqntcyp\",\"state\":\"PartiallyConnected\",\"instanceView\":{}}],\"managedBy\":\"Azure\"},\"id\":\"mwks\",\"name\":\"ircizjxvy\",\"type\":\"fceacvlhvygd\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"extensionParameters\":{\"forceUpdateTag\":\"twnawjslbiwkojgc\",\"publisher\":\"tsf\",\"type\":\"nbaeqphchqn\",\"typeHandlerVersion\":\"rpxeh\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datak\",\"protectedSettings\":\"dataaifmvikl\",\"enableAutomaticUpgrade\":false},\"aggregateState\":\"Deleted\",\"perNodeExtensionDetails\":[{\"name\":\"jdz\",\"extension\":\"cvdsrhnj\",\"typeHandlerVersion\":\"olvtnovqfzge\",\"state\":\"Succeeded\",\"instanceView\":{}},{\"name\":\"uljltduceamtmcz\",\"extension\":\"m\",\"typeHandlerVersion\":\"wcw\",\"state\":\"NotSpecified\",\"instanceView\":{}},{\"name\":\"nssxmojmsvpk\",\"extension\":\"rvkwc\",\"typeHandlerVersion\":\"ql\",\"state\":\"NotSpecified\",\"instanceView\":{}}],\"managedBy\":\"User\"},\"id\":\"heyd\",\"name\":\"sdshmkxmaehvb\",\"type\":\"xu\"},{\"properties\":{\"provisioningState\":\"Moving\",\"extensionParameters\":{\"forceUpdateTag\":\"n\",\"publisher\":\"baxk\",\"type\":\"ywrckp\",\"typeHandlerVersion\":\"lyhpluodpvruud\",\"autoUpgradeMinorVersion\":false,\"settings\":\"databth\",\"protectedSettings\":\"datatgk\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Error\",\"perNodeExtensionDetails\":[{\"name\":\"lzedqbcvhzlhplo\",\"extension\":\"kdl\",\"typeHandlerVersion\":\"qfbumlkxtrqjf\",\"state\":\"Updating\",\"instanceView\":{}},{\"name\":\"txhwgfws\",\"extension\":\"a\",\"typeHandlerVersion\":\"oezbrhubsk\",\"state\":\"PartiallyConnected\",\"instanceView\":{}}],\"managedBy\":\"User\"},\"id\":\"okkqfqjbvleo\",\"name\":\"fmluiqtqzfavyvn\",\"type\":\"qybaryeua\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"extensionParameters\":{\"forceUpdateTag\":\"qgzsles\",\"publisher\":\"bhernntiew\",\"type\":\"cv\",\"typeHandlerVersion\":\"uwrbehwagoh\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datakmr\",\"protectedSettings\":\"datamvvhmxtdrjfuta\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Accepted\",\"perNodeExtensionDetails\":[{\"name\":\"zcjznmwcpmgua\",\"extension\":\"raufactkahzova\",\"typeHandlerVersion\":\"ziuxxpshnee\",\"state\":\"Updating\",\"instanceView\":{}},{\"name\":\"slqubkwdl\",\"extension\":\"rds\",\"typeHandlerVersion\":\"ujbazpjuohminyfl\",\"state\":\"Succeeded\",\"instanceView\":{}},{\"name\":\"duvwpklvxwmygd\",\"extension\":\"gpqch\",\"typeHandlerVersion\":\"zepn\",\"state\":\"NotSpecified\",\"instanceView\":{}}],\"managedBy\":\"User\"},\"id\":\"ibbdaxconfoza\",\"name\":\"orsukokwbqp\",\"type\":\"hlvnuuepzlr\"}],\"nextLink\":\"wzsoldweyuqdunv\"}") - .toObject(ExtensionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionList model = new ExtensionList(); - model = BinaryData.fromObject(model).toObject(ExtensionList.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionParametersTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionParametersTests.java deleted file mode 100644 index f8a5c7574915..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionParametersTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionParameters; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionParameters model = BinaryData.fromString( - "{\"forceUpdateTag\":\"juisavokqdzf\",\"publisher\":\"zivj\",\"type\":\"rqttbajlkatnw\",\"typeHandlerVersion\":\"iopid\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datakuvscxkdm\",\"protectedSettings\":\"datagovibrxkpmloazu\",\"enableAutomaticUpgrade\":true}") - .toObject(ExtensionParameters.class); - Assertions.assertEquals("juisavokqdzf", model.forceUpdateTag()); - Assertions.assertEquals("zivj", model.publisher()); - Assertions.assertEquals("rqttbajlkatnw", model.type()); - Assertions.assertEquals("iopid", model.typeHandlerVersion()); - Assertions.assertEquals(true, model.autoUpgradeMinorVersion()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionParameters model = new ExtensionParameters().withForceUpdateTag("juisavokqdzf") - .withPublisher("zivj") - .withType("rqttbajlkatnw") - .withTypeHandlerVersion("iopid") - .withAutoUpgradeMinorVersion(true) - .withSettings("datakuvscxkdm") - .withProtectedSettings("datagovibrxkpmloazu") - .withEnableAutomaticUpgrade(true); - model = BinaryData.fromObject(model).toObject(ExtensionParameters.class); - Assertions.assertEquals("juisavokqdzf", model.forceUpdateTag()); - Assertions.assertEquals("zivj", model.publisher()); - Assertions.assertEquals("rqttbajlkatnw", model.type()); - Assertions.assertEquals("iopid", model.typeHandlerVersion()); - Assertions.assertEquals(true, model.autoUpgradeMinorVersion()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchParametersTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchParametersTests.java deleted file mode 100644 index a91a072ad7cd..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchParametersTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionPatchParameters model = BinaryData.fromString( - "{\"typeHandlerVersion\":\"dnhfuk\",\"enableAutomaticUpgrade\":true,\"settings\":\"datacswsmystul\",\"protectedSettings\":\"dataypfcvlerchpqbmf\"}") - .toObject(ExtensionPatchParameters.class); - Assertions.assertEquals("dnhfuk", model.typeHandlerVersion()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionPatchParameters model = new ExtensionPatchParameters().withTypeHandlerVersion("dnhfuk") - .withEnableAutomaticUpgrade(true) - .withSettings("datacswsmystul") - .withProtectedSettings("dataypfcvlerchpqbmf"); - model = BinaryData.fromObject(model).toObject(ExtensionPatchParameters.class); - Assertions.assertEquals("dnhfuk", model.typeHandlerVersion()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchPropertiesTests.java deleted file mode 100644 index 0903bd644e15..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionPatchProperties; -import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionPatchProperties model = BinaryData.fromString( - "{\"extensionParameters\":{\"typeHandlerVersion\":\"wvvb\",\"enableAutomaticUpgrade\":false,\"settings\":\"datal\",\"protectedSettings\":\"datahpodbzev\"}}") - .toObject(ExtensionPatchProperties.class); - Assertions.assertEquals("wvvb", model.extensionParameters().typeHandlerVersion()); - Assertions.assertEquals(false, model.extensionParameters().enableAutomaticUpgrade()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionPatchProperties model = new ExtensionPatchProperties() - .withExtensionParameters(new ExtensionPatchParameters().withTypeHandlerVersion("wvvb") - .withEnableAutomaticUpgrade(false) - .withSettings("datal") - .withProtectedSettings("datahpodbzev")); - model = BinaryData.fromObject(model).toObject(ExtensionPatchProperties.class); - Assertions.assertEquals("wvvb", model.extensionParameters().typeHandlerVersion()); - Assertions.assertEquals(false, model.extensionParameters().enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchTests.java deleted file mode 100644 index 0309afeaf6c5..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionPatchTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; -import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionPatch model = BinaryData.fromString( - "{\"properties\":{\"extensionParameters\":{\"typeHandlerVersion\":\"sjkmnwqj\",\"enableAutomaticUpgrade\":true,\"settings\":\"dataiyhddvi\",\"protectedSettings\":\"dataegfnmntfpmvmemfn\"}}}") - .toObject(ExtensionPatch.class); - Assertions.assertEquals("sjkmnwqj", model.extensionParameters().typeHandlerVersion()); - Assertions.assertEquals(true, model.extensionParameters().enableAutomaticUpgrade()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionPatch model = new ExtensionPatch() - .withExtensionParameters(new ExtensionPatchParameters().withTypeHandlerVersion("sjkmnwqj") - .withEnableAutomaticUpgrade(true) - .withSettings("dataiyhddvi") - .withProtectedSettings("dataegfnmntfpmvmemfn")); - model = BinaryData.fromObject(model).toObject(ExtensionPatch.class); - Assertions.assertEquals("sjkmnwqj", model.extensionParameters().typeHandlerVersion()); - Assertions.assertEquals(true, model.extensionParameters().enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionProfileTests.java deleted file mode 100644 index 3d92530fd628..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionProfileTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionProfile; - -public final class ExtensionProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionProfile model = BinaryData.fromString( - "{\"extensions\":[{\"extensionName\":\"dyvt\",\"state\":\"Failed\",\"errorDetails\":[{\"exception\":\"piudeugfsxzecpa\"}],\"extensionResourceId\":\"kufykhvu\",\"typeHandlerVersion\":\"epmrut\",\"managedBy\":\"Azure\"},{\"extensionName\":\"aobn\",\"state\":\"Canceled\",\"errorDetails\":[{\"exception\":\"ltymkmvguihywart\"},{\"exception\":\"phkixkykxdssjpe\"}],\"extensionResourceId\":\"ucfx\",\"typeHandlerVersion\":\"kkflrmymyincqlhr\",\"managedBy\":\"Azure\"}]}") - .toObject(ExtensionProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionProfile model = new ExtensionProfile(); - model = BinaryData.fromObject(model).toObject(ExtensionProfile.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionUpgradeParametersTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionUpgradeParametersTests.java deleted file mode 100644 index 45520bcded0d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionUpgradeParametersTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionUpgradeParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionUpgradeParameters model - = BinaryData.fromString("{\"targetVersion\":\"babwidfcxss\"}").toObject(ExtensionUpgradeParameters.class); - Assertions.assertEquals("babwidfcxss", model.targetVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionUpgradeParameters model = new ExtensionUpgradeParameters().withTargetVersion("babwidfcxss"); - model = BinaryData.fromObject(model).toObject(ExtensionUpgradeParameters.class); - Assertions.assertEquals("babwidfcxss", model.targetVersion()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateMockTests.java deleted file mode 100644 index 8699a0f33873..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateMockTests.java +++ /dev/null @@ -1,53 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"extensionParameters\":{\"forceUpdateTag\":\"oyrfgxk\",\"publisher\":\"pmypgfq\",\"type\":\"tyw\",\"typeHandlerVersion\":\"a\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datajpewpyjlfx\",\"protectedSettings\":\"datapqcrzgeuqxbpiat\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Succeeded\",\"perNodeExtensionDetails\":[{\"name\":\"d\",\"extension\":\"dr\",\"typeHandlerVersion\":\"gddhjkrukizyhgs\",\"state\":\"Moving\",\"instanceView\":{\"name\":\"ktxqfpjbqgg\",\"type\":\"eiwdhdmncgbfzu\",\"typeHandlerVersion\":\"stunmlh\",\"status\":{}}},{\"name\":\"bkl\",\"extension\":\"ich\",\"typeHandlerVersion\":\"sysmvxodgw\",\"state\":\"Failed\",\"instanceView\":{\"name\":\"ifc\",\"type\":\"bdujgcwxvecbb\",\"typeHandlerVersion\":\"trdxri\",\"status\":{}}},{\"name\":\"bbgiarksykpgdqxw\",\"extension\":\"zrwiqrxha\",\"typeHandlerVersion\":\"cdosqkptj\",\"state\":\"Canceled\",\"instanceView\":{\"name\":\"mmainwhe\",\"type\":\"kp\",\"typeHandlerVersion\":\"wuntobuiz\",\"status\":{}}}],\"managedBy\":\"Azure\"},\"id\":\"wgvydjufb\",\"name\":\"klblaxp\",\"type\":\"gjwdab\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Extension response = manager.extensions() - .define("xkf") - .withExistingArcSetting("neakh", "mhobcyan", "fvqtvkhgvoo") - .withForceUpdateTag("mhcctopuowy") - .withPublisher("skbyhquhczygx") - .withTypePropertiesType("ajpxecxqnwhscoza") - .withTypeHandlerVersion("vgxsm") - .withAutoUpgradeMinorVersion(true) - .withSettings("datawirfljf") - .withProtectedSettings("dataxqou") - .withEnableAutomaticUpgrade(false) - .create(); - - Assertions.assertEquals("oyrfgxk", response.forceUpdateTag()); - Assertions.assertEquals("pmypgfq", response.publisher()); - Assertions.assertEquals("tyw", response.typePropertiesType()); - Assertions.assertEquals("a", response.typeHandlerVersion()); - Assertions.assertEquals(false, response.autoUpgradeMinorVersion()); - Assertions.assertEquals(true, response.enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteMockTests.java deleted file mode 100644 index 78cc78e0c2f5..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions() - .delete("vsnvlaq", "nzyzawatuwqko", "bczothymgobllms", "wgwima", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetWithResponseMockTests.java deleted file mode 100644 index af490f165274..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Error\",\"extensionParameters\":{\"forceUpdateTag\":\"h\",\"publisher\":\"jsbcml\",\"type\":\"ahz\",\"typeHandlerVersion\":\"uroolkolirhhm\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datau\",\"protectedSettings\":\"datafjzc\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Error\",\"perNodeExtensionDetails\":[{\"name\":\"ahfxwccok\",\"extension\":\"kuk\",\"typeHandlerVersion\":\"c\",\"state\":\"PartiallySucceeded\",\"instanceView\":{\"name\":\"hoqeqshavljqk\",\"type\":\"rqolnthbb\",\"typeHandlerVersion\":\"gzukw\",\"status\":{}}},{\"name\":\"zkjthfceyjn\",\"extension\":\"mlfuyfjbp\",\"typeHandlerVersion\":\"ddhlrufzcqyj\",\"state\":\"Canceled\",\"instanceView\":{\"name\":\"iocuselqkr\",\"type\":\"zrhxuddqmdtf\",\"typeHandlerVersion\":\"sjmrkkhm\",\"status\":{}}}],\"managedBy\":\"Azure\"},\"id\":\"gyqi\",\"name\":\"okwtjawhvagnqfqq\",\"type\":\"lcvmyolcaymjch\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Extension response = manager.extensions() - .getWithResponse("ikff", "fgkuh", "nwhvuldbkkejj", "jigawgaz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("h", response.forceUpdateTag()); - Assertions.assertEquals("jsbcml", response.publisher()); - Assertions.assertEquals("ahz", response.typePropertiesType()); - Assertions.assertEquals("uroolkolirhhm", response.typeHandlerVersion()); - Assertions.assertEquals(true, response.autoUpgradeMinorVersion()); - Assertions.assertEquals(true, response.enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingMockTests.java deleted file mode 100644 index 619858e267a3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsListByArcSettingMockTests { - @Test - public void testListByArcSetting() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Connected\",\"extensionParameters\":{\"forceUpdateTag\":\"ylrwoxzg\",\"publisher\":\"syxjijeyp\",\"type\":\"rbkerdkd\",\"typeHandlerVersion\":\"awqwjxild\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datafeygzqp\",\"protectedSettings\":\"dataisf\",\"enableAutomaticUpgrade\":true},\"aggregateState\":\"Deleting\",\"perNodeExtensionDetails\":[{\"name\":\"xumentqontwhy\",\"extension\":\"ymulwivqtowl\",\"typeHandlerVersion\":\"sycoybajasqub\",\"state\":\"Canceled\",\"instanceView\":{\"name\":\"whjq\",\"type\":\"chqohtfxcpupuk\",\"typeHandlerVersion\":\"mjzpwdlvwtiwsm\",\"status\":{}}},{\"name\":\"onhqnam\",\"extension\":\"ultassae\",\"typeHandlerVersion\":\"wnaze\",\"state\":\"PartiallyConnected\",\"instanceView\":{\"name\":\"jlcyizy\",\"type\":\"cvxodkrvfsxxby\",\"typeHandlerVersion\":\"sqlv\",\"status\":{}}},{\"name\":\"pwgoljt\",\"extension\":\"nm\",\"typeHandlerVersion\":\"dobygoogxqapj\",\"state\":\"Updating\",\"instanceView\":{\"name\":\"jfucsaodjnosdkv\",\"type\":\"fasgm\",\"typeHandlerVersion\":\"rnzpducdaak\",\"status\":{}}}],\"managedBy\":\"User\"},\"id\":\"zboimyfpqdo\",\"name\":\"kpp\",\"type\":\"wyytfvpctf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.extensions().listByArcSetting("j", "hfjv", "ywjzebecuvlbefvw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ylrwoxzg", response.iterator().next().forceUpdateTag()); - Assertions.assertEquals("syxjijeyp", response.iterator().next().publisher()); - Assertions.assertEquals("rbkerdkd", response.iterator().next().typePropertiesType()); - Assertions.assertEquals("awqwjxild", response.iterator().next().typeHandlerVersion()); - Assertions.assertEquals(true, response.iterator().next().autoUpgradeMinorVersion()); - Assertions.assertEquals(true, response.iterator().next().enableAutomaticUpgrade()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceAdapterPropertyOverridesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceAdapterPropertyOverridesTests.java deleted file mode 100644 index 65e15309e3c3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceAdapterPropertyOverridesTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceAdapterPropertyOverrides; - -public final class HciEdgeDeviceAdapterPropertyOverridesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceAdapterPropertyOverrides model = BinaryData.fromString( - "{\"jumboPacket\":\"etlgydlhqvlnnpx\",\"networkDirect\":\"afiqgeaarbgjekg\",\"networkDirectTechnology\":\"lbyulidwcwvmze\"}") - .toObject(HciEdgeDeviceAdapterPropertyOverrides.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceAdapterPropertyOverrides model = new HciEdgeDeviceAdapterPropertyOverrides(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceAdapterPropertyOverrides.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceArcExtensionTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceArcExtensionTests.java deleted file mode 100644 index 958bf556bc0e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceArcExtensionTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceArcExtension; - -public final class HciEdgeDeviceArcExtensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceArcExtension model = BinaryData.fromString( - "{\"extensionName\":\"csgguxhemlw\",\"state\":\"Failed\",\"errorDetails\":[{\"exception\":\"zgfbukklelssx\"},{\"exception\":\"ycsxzu\"}],\"extensionResourceId\":\"srlsmd\",\"typeHandlerVersion\":\"qplpvmjc\",\"managedBy\":\"Azure\"}") - .toObject(HciEdgeDeviceArcExtension.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceArcExtension model = new HciEdgeDeviceArcExtension(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceArcExtension.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceHostNetworkTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceHostNetworkTests.java deleted file mode 100644 index a9ae16522831..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceHostNetworkTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceHostNetwork; - -public final class HciEdgeDeviceHostNetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceHostNetwork model = BinaryData.fromString( - "{\"intents\":[{\"scope\":5884898647317147170,\"intentType\":7373453807299049172,\"isComputeIntentSet\":true,\"isStorageIntentSet\":true,\"isOnlyStorage\":false,\"isManagementIntentSet\":true,\"isStretchIntentSet\":false,\"isOnlyStretch\":true,\"isNetworkIntentType\":true,\"intentName\":\"jtqpkevmyltjcrsp\",\"intentAdapters\":[\"urcclfgxannn\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"osewxi\",\"loadBalancingAlgorithm\":\"xvkqm\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"pifdfaifyzyzeyu\",\"priorityValue8021Action_SMB\":\"eidszlfytoi\",\"bandwidthPercentage_SMB\":\"gygvfltgvdiho\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"wetwkdr\",\"networkDirect\":\"rucpcunnuz\",\"networkDirectTechnology\":\"umoenodnaie\"}},{\"scope\":1915335915465694724,\"intentType\":2869725107251122728,\"isComputeIntentSet\":true,\"isStorageIntentSet\":true,\"isOnlyStorage\":false,\"isManagementIntentSet\":true,\"isStretchIntentSet\":true,\"isOnlyStretch\":false,\"isNetworkIntentType\":true,\"intentName\":\"anniyopetxivcnr\",\"intentAdapters\":[\"nucaephblkwqpat\",\"bqsdtcjbctvi\",\"uzqymtuowog\",\"gitsqh\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"cdb\",\"loadBalancingAlgorithm\":\"fzndscxmxeatkd\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"djyibqbnaomhjrm\",\"priorityValue8021Action_SMB\":\"hmaxljalfi\",\"bandwidthPercentage_SMB\":\"jmobca\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"xqcwgax\",\"networkDirect\":\"vaknokzwjj\",\"networkDirectTechnology\":\"ltixldzyyfytpq\"}},{\"scope\":360408231688431351,\"intentType\":450241632705489744,\"isComputeIntentSet\":true,\"isStorageIntentSet\":true,\"isOnlyStorage\":false,\"isManagementIntentSet\":false,\"isStretchIntentSet\":false,\"isOnlyStretch\":true,\"isNetworkIntentType\":true,\"intentName\":\"slzoyov\",\"intentAdapters\":[\"bpqvybefg\",\"mx\",\"okcvtlubses\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"rtrh\",\"loadBalancingAlgorithm\":\"lpi\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"ndzfqivjreuyk\",\"priorityValue8021Action_SMB\":\"mnwagltbxoe\",\"bandwidthPercentage_SMB\":\"nqlnfwmyymvqd\"},\"overrideAdapterProperty\":true,\"adapterPropertyOverrides\":{\"jumboPacket\":\"ckdvez\",\"networkDirect\":\"cssbzhddu\",\"networkDirectTechnology\":\"nqfblhkalehpava\"}}],\"storageNetworks\":[{\"name\":\"qjtiogqgdm\",\"networkAdapterName\":\"i\",\"storageVlanId\":\"teajohiyg\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"onhpcz\",\"ipv4Address\":\"mktp\",\"subnetMask\":\"xqcsehch\"}]},{\"name\":\"ufmpqumqyjgy\",\"networkAdapterName\":\"ulodsaeuzanhsfnh\",\"storageVlanId\":\"nwph\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"gqjclidftujwj\",\"ipv4Address\":\"fwbeqrkuorh\",\"subnetMask\":\"sruqnmdvha\"}]},{\"name\":\"vjytiqswbq\",\"networkAdapterName\":\"zwxiytx\",\"storageVlanId\":\"gukvlbpkt\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"youambewr\",\"ipv4Address\":\"wmowegmmute\",\"subnetMask\":\"eyguq\"},{\"physicalNode\":\"ijiitns\",\"ipv4Address\":\"lz\",\"subnetMask\":\"sygrijwa\"}]}],\"storageConnectivitySwitchless\":true,\"enableStorageAutoIp\":false}") - .toObject(HciEdgeDeviceHostNetwork.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceHostNetwork model = new HciEdgeDeviceHostNetwork(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceHostNetwork.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceIntentsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceIntentsTests.java deleted file mode 100644 index b4dad8a6d8c6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceIntentsTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceIntents; - -public final class HciEdgeDeviceIntentsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceIntents model = BinaryData.fromString( - "{\"scope\":5264572526538561832,\"intentType\":175416950845015202,\"isComputeIntentSet\":true,\"isStorageIntentSet\":false,\"isOnlyStorage\":true,\"isManagementIntentSet\":false,\"isStretchIntentSet\":false,\"isOnlyStretch\":false,\"isNetworkIntentType\":true,\"intentName\":\"ygywe\",\"intentAdapters\":[\"iecafygzmxi\",\"qv\",\"smaklixqcahy\"],\"overrideVirtualSwitchConfiguration\":true,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"bx\",\"loadBalancingAlgorithm\":\"oij\"},\"overrideQosPolicy\":false,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"lxp\",\"priorityValue8021Action_SMB\":\"wjdjodqhykin\",\"bandwidthPercentage_SMB\":\"rem\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"zhceumoqodk\",\"networkDirect\":\"ppyi\",\"networkDirectTechnology\":\"gqladywrxwhyd\"}}") - .toObject(HciEdgeDeviceIntents.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceIntents model = new HciEdgeDeviceIntents(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceIntents.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageAdapterIpInfoTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageAdapterIpInfoTests.java deleted file mode 100644 index 03be4e81d1f5..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageAdapterIpInfoTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceStorageAdapterIpInfo; - -public final class HciEdgeDeviceStorageAdapterIpInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceStorageAdapterIpInfo model = BinaryData - .fromString( - "{\"physicalNode\":\"fratqxmbjroumzz\",\"ipv4Address\":\"al\",\"subnetMask\":\"rhuzgfxonjtpu\"}") - .toObject(HciEdgeDeviceStorageAdapterIpInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceStorageAdapterIpInfo model = new HciEdgeDeviceStorageAdapterIpInfo(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceStorageAdapterIpInfo.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageNetworksTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageNetworksTests.java deleted file mode 100644 index 153d3f59a389..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceStorageNetworksTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceStorageNetworks; - -public final class HciEdgeDeviceStorageNetworksTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceStorageNetworks model = BinaryData.fromString( - "{\"name\":\"nwyrmouv\",\"networkAdapterName\":\"gmokzkltrfowt\",\"storageVlanId\":\"rfmvlihcvjdrqcrj\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"tuk\",\"ipv4Address\":\"dxlwyojbfqz\",\"subnetMask\":\"fnjyix\"}]}") - .toObject(HciEdgeDeviceStorageNetworks.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceStorageNetworks model = new HciEdgeDeviceStorageNetworks(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceStorageNetworks.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceVirtualSwitchConfigurationOverridesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceVirtualSwitchConfigurationOverridesTests.java deleted file mode 100644 index caee958afba4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciEdgeDeviceVirtualSwitchConfigurationOverridesTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceVirtualSwitchConfigurationOverrides; - -public final class HciEdgeDeviceVirtualSwitchConfigurationOverridesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciEdgeDeviceVirtualSwitchConfigurationOverrides model - = BinaryData.fromString("{\"enableIov\":\"uvvadswzsnu\",\"loadBalancingAlgorithm\":\"mlowuowhl\"}") - .toObject(HciEdgeDeviceVirtualSwitchConfigurationOverrides.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciEdgeDeviceVirtualSwitchConfigurationOverrides model = new HciEdgeDeviceVirtualSwitchConfigurationOverrides(); - model = BinaryData.fromObject(model).toObject(HciEdgeDeviceVirtualSwitchConfigurationOverrides.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNetworkProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNetworkProfileTests.java deleted file mode 100644 index 10ebe967b14c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNetworkProfileTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciNetworkProfile; - -public final class HciNetworkProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciNetworkProfile model = BinaryData.fromString( - "{\"nicDetails\":[{\"adapterName\":\"a\",\"interfaceDescription\":\"d\",\"componentId\":\"owftptnuwjtks\",\"driverVersion\":\"gcgqyhleseyqrhvy\",\"ip4Address\":\"dotjvdk\",\"subnetMask\":\"swskuk\",\"defaultGateway\":\"asbvw\",\"dnsServers\":[\"kxkdtxfkndlq\",\"twknvgm\",\"bugtywatmqa\"],\"defaultIsolationId\":\"ueatgroe\",\"macAddress\":\"oygzcbyfqxkfao\",\"slot\":\"ehqpuvjmvqmt\",\"switchName\":\"ckygroejnndljdju\",\"nicType\":\"br\",\"vlanId\":\"qyn\",\"nicStatus\":\"eysfaqegplw\"},{\"adapterName\":\"shwddkvbxgk\",\"interfaceDescription\":\"sybwptdaca\",\"componentId\":\"vlf\",\"driverVersion\":\"ymtpo\",\"ip4Address\":\"enazerohzrsqals\",\"subnetMask\":\"dnwqapfg\",\"defaultGateway\":\"pcvessm\",\"dnsServers\":[\"kuui\"],\"defaultIsolationId\":\"dqq\",\"macAddress\":\"ekvalblhtjq\",\"slot\":\"yvwehtaemxh\",\"switchName\":\"ysev\",\"nicType\":\"xivzrrry\",\"vlanId\":\"imipskdyzatvfuz\",\"nicStatus\":\"ftjvvruxwigsye\"}],\"switchDetails\":[{\"switchName\":\"smjtgrqgdg\",\"switchType\":\"ileplk\",\"extensions\":[{\"switchId\":\"nhwtbbaedorvv\",\"extensionName\":\"floygbdgwumg\",\"extensionEnabled\":true},{\"switchId\":\"hpabgdexjddvjs\",\"extensionName\":\"wotmmwllcolsrsxa\",\"extensionEnabled\":false},{\"switchId\":\"hexcgjokj\",\"extensionName\":\"nhvlqjbekp\",\"extensionEnabled\":true},{\"switchId\":\"nbksd\",\"extensionName\":\"jvyklxeslkhhust\",\"extensionEnabled\":true}]},{\"switchName\":\"mavnw\",\"switchType\":\"wgoknlejjjkx\",\"extensions\":[{\"switchId\":\"dbkjbztensvkzykj\",\"extensionName\":\"kns\",\"extensionEnabled\":false}]}],\"hostNetwork\":{\"intents\":[{\"scope\":3770036618007889355,\"intentType\":1353614778272495445,\"isComputeIntentSet\":true,\"isStorageIntentSet\":true,\"isOnlyStorage\":false,\"isManagementIntentSet\":true,\"isStretchIntentSet\":true,\"isOnlyStretch\":true,\"isNetworkIntentType\":true,\"intentName\":\"iojfizfavkjzwfbc\",\"intentAdapters\":[\"kmmfzsbf\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"mdew\",\"loadBalancingAlgorithm\":\"sxkrpl\"},\"overrideQosPolicy\":false,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"jwwviy\",\"priorityValue8021Action_SMB\":\"ps\",\"bandwidthPercentage_SMB\":\"brnnhjxsqw\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"iwetpoz\",\"networkDirect\":\"yqiq\",\"networkDirectTechnology\":\"gfsetzlexbsfled\"}},{\"scope\":1059667213155594748,\"intentType\":2377826274208765627,\"isComputeIntentSet\":false,\"isStorageIntentSet\":false,\"isOnlyStorage\":true,\"isManagementIntentSet\":false,\"isStretchIntentSet\":false,\"isOnlyStretch\":false,\"isNetworkIntentType\":true,\"intentName\":\"ljselp\",\"intentAdapters\":[\"afvafh\",\"by\",\"ccbevxrhyzdf\",\"rsofpltdbmairrh\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"acwn\",\"loadBalancingAlgorithm\":\"igtuu\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"dawsigrbjb\",\"priorityValue8021Action_SMB\":\"jybvit\",\"bandwidthPercentage_SMB\":\"kjyaznumtg\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"ch\",\"networkDirect\":\"fnkf\",\"networkDirectTechnology\":\"lv\"}},{\"scope\":573222547469009901,\"intentType\":7797656373542961673,\"isComputeIntentSet\":true,\"isStorageIntentSet\":true,\"isOnlyStorage\":false,\"isManagementIntentSet\":false,\"isStretchIntentSet\":true,\"isOnlyStretch\":true,\"isNetworkIntentType\":false,\"intentName\":\"yxl\",\"intentAdapters\":[\"phvxz\",\"wxh\"],\"overrideVirtualSwitchConfiguration\":false,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"lkexaonwivkcqh\",\"loadBalancingAlgorithm\":\"hxknlccrmmkyupi\"},\"overrideQosPolicy\":true,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"jfkakfqfrke\",\"priorityValue8021Action_SMB\":\"il\",\"bandwidthPercentage_SMB\":\"dxjascowvfdj\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"hlkks\",\"networkDirect\":\"gzv\",\"networkDirectTechnology\":\"ij\"}},{\"scope\":3551520708660525031,\"intentType\":8691287452802237502,\"isComputeIntentSet\":false,\"isStorageIntentSet\":false,\"isOnlyStorage\":false,\"isManagementIntentSet\":false,\"isStretchIntentSet\":false,\"isOnlyStretch\":false,\"isNetworkIntentType\":false,\"intentName\":\"qulsutrjbhxykfhy\",\"intentAdapters\":[\"vqqugdrftbcv\",\"xreuquowtlj\",\"fwhreagkhyxv\",\"qtvbczsu\"],\"overrideVirtualSwitchConfiguration\":true,\"virtualSwitchConfigurationOverrides\":{\"enableIov\":\"lmepjpf\",\"loadBalancingAlgorithm\":\"ykgsangpszng\"},\"overrideQosPolicy\":false,\"qosPolicyOverrides\":{\"priorityValue8021Action_Cluster\":\"lkvec\",\"priorityValue8021Action_SMB\":\"jcngoadyed\",\"bandwidthPercentage_SMB\":\"rgjfoknubnoi\"},\"overrideAdapterProperty\":false,\"adapterPropertyOverrides\":{\"jumboPacket\":\"trgdgxvc\",\"networkDirect\":\"raswugyxpqit\",\"networkDirectTechnology\":\"ialwv\"}}],\"storageNetworks\":[{\"name\":\"hzacaqtyltco\",\"networkAdapterName\":\"ujpdsxzak\",\"storageVlanId\":\"jkmvbi\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"fqcvovj\",\"ipv4Address\":\"ycsjmlbem\",\"subnetMask\":\"jiriuxeg\"},{\"physicalNode\":\"ortudawlpjfel\",\"ipv4Address\":\"rpptcbgqnzmnhiil\",\"subnetMask\":\"lwcjgckbbcccgzpr\"},{\"physicalNode\":\"xnyuffatsgftipwc\",\"ipv4Address\":\"yubhiqdx\",\"subnetMask\":\"rnpnuhzafccnuh\"},{\"physicalNode\":\"gbylbuig\",\"ipv4Address\":\"vatvcrkd\",\"subnetMask\":\"nbqxvhcsyhzlwxae\"}]},{\"name\":\"vurex\",\"networkAdapterName\":\"d\",\"storageVlanId\":\"dwead\",\"storageAdapterIPInfo\":[{\"physicalNode\":\"wntopag\",\"ipv4Address\":\"mvmmagoaqylkjz\",\"subnetMask\":\"iua\"},{\"physicalNode\":\"cgm\",\"ipv4Address\":\"tpfinzcpdltkr\",\"subnetMask\":\"jmtbd\"},{\"physicalNode\":\"cqguef\",\"ipv4Address\":\"ompheqdur\",\"subnetMask\":\"yujlfyoumpckyecl\"}]}],\"storageConnectivitySwitchless\":true,\"enableStorageAutoIp\":true}}") - .toObject(HciNetworkProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciNetworkProfile model = new HciNetworkProfile(); - model = BinaryData.fromObject(model).toObject(HciNetworkProfile.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNicDetailTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNicDetailTests.java deleted file mode 100644 index b751b228383f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciNicDetailTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciNicDetail; - -public final class HciNicDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciNicDetail model = BinaryData.fromString( - "{\"adapterName\":\"ajbrzmqxucy\",\"interfaceDescription\":\"joclxiutgjcyzy\",\"componentId\":\"dnrqjbtxj\",\"driverVersion\":\"oqa\",\"ip4Address\":\"z\",\"subnetMask\":\"hfw\",\"defaultGateway\":\"uatbwbqamteuliy\",\"dnsServers\":[\"kcvmwfauxxepmy\",\"bormcqmiciijqpkz\"],\"defaultIsolationId\":\"ojxjmcsmyqwix\",\"macAddress\":\"pwnkwywzwo\",\"slot\":\"lickduoi\",\"switchName\":\"amt\",\"nicType\":\"sknxrwzawnvsbcf\",\"vlanId\":\"agxnvhycvdimw\",\"nicStatus\":\"regzgyufutrwpwer\"}") - .toObject(HciNicDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciNicDetail model = new HciNicDetail(); - model = BinaryData.fromObject(model).toObject(HciNicDetail.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciOsProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciOsProfileTests.java deleted file mode 100644 index 8fd0cd505b59..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciOsProfileTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciOsProfile; - -public final class HciOsProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciOsProfile model - = BinaryData.fromString("{\"bootType\":\"l\",\"assemblyVersion\":\"pvti\"}").toObject(HciOsProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciOsProfile model = new HciOsProfile(); - model = BinaryData.fromObject(model).toObject(HciOsProfile.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciValidationFailureDetailTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciValidationFailureDetailTests.java deleted file mode 100644 index f78825e105a3..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HciValidationFailureDetailTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HciValidationFailureDetail; - -public final class HciValidationFailureDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HciValidationFailureDetail model - = BinaryData.fromString("{\"exception\":\"ytmhdroznnhdrlkt\"}").toObject(HciValidationFailureDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HciValidationFailureDetail model = new HciValidationFailureDetail(); - model = BinaryData.fromObject(model).toObject(HciValidationFailureDetail.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InfrastructureNetworkTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InfrastructureNetworkTests.java deleted file mode 100644 index 749bb5e567e1..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InfrastructureNetworkTests.java +++ /dev/null @@ -1,42 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.InfrastructureNetwork; -import com.azure.resourcemanager.azurestackhci.models.IpPools; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InfrastructureNetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InfrastructureNetwork model = BinaryData.fromString( - "{\"subnetMask\":\"tpnapnyiropuhpig\",\"gateway\":\"gylgqgitxmedjvcs\",\"ipPools\":[{\"startingAddress\":\"wwncwzzhxgk\",\"endingAddress\":\"mgucna\"}],\"dnsServers\":[\"eoellwptfdygp\"],\"useDhcp\":false}") - .toObject(InfrastructureNetwork.class); - Assertions.assertEquals("tpnapnyiropuhpig", model.subnetMask()); - Assertions.assertEquals("gylgqgitxmedjvcs", model.gateway()); - Assertions.assertEquals("wwncwzzhxgk", model.ipPools().get(0).startingAddress()); - Assertions.assertEquals("mgucna", model.ipPools().get(0).endingAddress()); - Assertions.assertEquals("eoellwptfdygp", model.dnsServers().get(0)); - Assertions.assertEquals(false, model.useDhcp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InfrastructureNetwork model = new InfrastructureNetwork().withSubnetMask("tpnapnyiropuhpig") - .withGateway("gylgqgitxmedjvcs") - .withIpPools(Arrays.asList(new IpPools().withStartingAddress("wwncwzzhxgk").withEndingAddress("mgucna"))) - .withDnsServers(Arrays.asList("eoellwptfdygp")) - .withUseDhcp(false); - model = BinaryData.fromObject(model).toObject(InfrastructureNetwork.class); - Assertions.assertEquals("tpnapnyiropuhpig", model.subnetMask()); - Assertions.assertEquals("gylgqgitxmedjvcs", model.gateway()); - Assertions.assertEquals("wwncwzzhxgk", model.ipPools().get(0).startingAddress()); - Assertions.assertEquals("mgucna", model.ipPools().get(0).endingAddress()); - Assertions.assertEquals("eoellwptfdygp", model.dnsServers().get(0)); - Assertions.assertEquals(false, model.useDhcp()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolsTests.java deleted file mode 100644 index 2729cc36fb4e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolsTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.IpPools; -import org.junit.jupiter.api.Assertions; - -public final class IpPoolsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPools model = BinaryData.fromString("{\"startingAddress\":\"ac\",\"endingAddress\":\"pzfqrhhuaoppp\"}") - .toObject(IpPools.class); - Assertions.assertEquals("ac", model.startingAddress()); - Assertions.assertEquals("pzfqrhhuaoppp", model.endingAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPools model = new IpPools().withStartingAddress("ac").withEndingAddress("pzfqrhhuaoppp"); - model = BinaryData.fromObject(model).toObject(IpPools.class); - Assertions.assertEquals("ac", model.startingAddress()); - Assertions.assertEquals("pzfqrhhuaoppp", model.endingAddress()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IsolatedVmAttestationConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IsolatedVmAttestationConfigurationTests.java deleted file mode 100644 index 01aa89d7d2d9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IsolatedVmAttestationConfigurationTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; - -public final class IsolatedVmAttestationConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IsolatedVmAttestationConfiguration model = BinaryData.fromString( - "{\"attestationResourceId\":\"bjtazqugxywpmu\",\"relyingPartyServiceEndpoint\":\"fjz\",\"attestationServiceEndpoint\":\"qkqujidsu\"}") - .toObject(IsolatedVmAttestationConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IsolatedVmAttestationConfiguration model = new IsolatedVmAttestationConfiguration(); - model = BinaryData.fromObject(model).toObject(IsolatedVmAttestationConfiguration.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestPropertiesTests.java deleted file mode 100644 index 67c4d70d0168..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequestProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogCollectionRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogCollectionRequestProperties model - = BinaryData.fromString("{\"fromDate\":\"2021-05-19T13:40:02Z\",\"toDate\":\"2021-04-27T11:03:59Z\"}") - .toObject(LogCollectionRequestProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T13:40:02Z"), model.fromDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.toDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogCollectionRequestProperties model - = new LogCollectionRequestProperties().withFromDate(OffsetDateTime.parse("2021-05-19T13:40:02Z")) - .withToDate(OffsetDateTime.parse("2021-04-27T11:03:59Z")); - model = BinaryData.fromObject(model).toObject(LogCollectionRequestProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T13:40:02Z"), model.fromDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.toDate()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestTests.java deleted file mode 100644 index aa84e6423f39..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogCollectionRequestTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequest; -import com.azure.resourcemanager.azurestackhci.models.LogCollectionRequestProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogCollectionRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogCollectionRequest model = BinaryData - .fromString("{\"properties\":{\"fromDate\":\"2021-03-03T22:53:05Z\",\"toDate\":\"2021-07-20T02:15:21Z\"}}") - .toObject(LogCollectionRequest.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T22:53:05Z"), model.properties().fromDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T02:15:21Z"), model.properties().toDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogCollectionRequest model = new LogCollectionRequest().withProperties( - new LogCollectionRequestProperties().withFromDate(OffsetDateTime.parse("2021-03-03T22:53:05Z")) - .withToDate(OffsetDateTime.parse("2021-07-20T02:15:21Z"))); - model = BinaryData.fromObject(model).toObject(LogCollectionRequest.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T22:53:05Z"), model.properties().fromDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T02:15:21Z"), model.properties().toDate()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ManagedServiceIdentityTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 7cea54365d07..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ManagedServiceIdentityTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ManagedServiceIdentity; -import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"a5c24148-2f49-4e8b-bd72-e7d180e578d2\",\"tenantId\":\"c653076d-85aa-4e3f-9132-11446b048d73\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"md\":{\"principalId\":\"f3592502-199f-4063-9bed-4202ad1db15c\",\"clientId\":\"6af757ec-59cd-49ec-a9af-468fce710068\"},\"g\":{\"principalId\":\"9d2a8b2a-b8e1-4321-8c8f-86e14e417a86\",\"clientId\":\"0ab61bbc-75ac-4dfb-8c29-714bed6a9bd7\"},\"buxwgip\":{\"principalId\":\"af28fd9f-5c8b-4f9f-a28f-3ccdebb25186\",\"clientId\":\"44b41844-ec92-48b9-b6da-57c813d96daf\"},\"nowkgshw\":{\"principalId\":\"f1464e31-303e-4876-b01b-cc5cbc8bf166\",\"clientId\":\"cabaec61-711c-4987-aa00-c1ad59901c29\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model - = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("md", new UserAssignedIdentity(), "g", new UserAssignedIdentity(), - "buxwgip", new UserAssignedIdentity(), "nowkgshw", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkControllerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkControllerTests.java deleted file mode 100644 index d01c6de8f1dc..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkControllerTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.NetworkController; -import org.junit.jupiter.api.Assertions; - -public final class NetworkControllerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkController model = BinaryData - .fromString( - "{\"macAddressPoolStart\":\"fv\",\"macAddressPoolStop\":\"fy\",\"networkVirtualizationEnabled\":false}") - .toObject(NetworkController.class); - Assertions.assertEquals("fv", model.macAddressPoolStart()); - Assertions.assertEquals("fy", model.macAddressPoolStop()); - Assertions.assertEquals(false, model.networkVirtualizationEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkController model = new NetworkController().withMacAddressPoolStart("fv") - .withMacAddressPoolStop("fy") - .withNetworkVirtualizationEnabled(false); - model = BinaryData.fromObject(model).toObject(NetworkController.class); - Assertions.assertEquals("fv", model.macAddressPoolStart()); - Assertions.assertEquals("fy", model.macAddressPoolStop()); - Assertions.assertEquals(false, model.networkVirtualizationEnabled()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NicDetailTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NicDetailTests.java deleted file mode 100644 index 665e0c29922e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NicDetailTests.java +++ /dev/null @@ -1,51 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.NicDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NicDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NicDetail model = BinaryData.fromString( - "{\"adapterName\":\"vqejosovy\",\"interfaceDescription\":\"leaesi\",\"componentId\":\"qtljqobbpihehc\",\"driverVersion\":\"ybmrqbrjbbmp\",\"ip4Address\":\"lvykfrex\",\"subnetMask\":\"s\",\"defaultGateway\":\"wjksghudgzhxo\",\"dnsServers\":[\"gsv\",\"u\",\"kxibdafh\",\"kmdyomkxfbvfbh\"],\"defaultIsolationId\":\"i\"}") - .toObject(NicDetail.class); - Assertions.assertEquals("vqejosovy", model.adapterName()); - Assertions.assertEquals("leaesi", model.interfaceDescription()); - Assertions.assertEquals("qtljqobbpihehc", model.componentId()); - Assertions.assertEquals("ybmrqbrjbbmp", model.driverVersion()); - Assertions.assertEquals("lvykfrex", model.ip4Address()); - Assertions.assertEquals("s", model.subnetMask()); - Assertions.assertEquals("wjksghudgzhxo", model.defaultGateway()); - Assertions.assertEquals("gsv", model.dnsServers().get(0)); - Assertions.assertEquals("i", model.defaultIsolationId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NicDetail model = new NicDetail().withAdapterName("vqejosovy") - .withInterfaceDescription("leaesi") - .withComponentId("qtljqobbpihehc") - .withDriverVersion("ybmrqbrjbbmp") - .withIp4Address("lvykfrex") - .withSubnetMask("s") - .withDefaultGateway("wjksghudgzhxo") - .withDnsServers(Arrays.asList("gsv", "u", "kxibdafh", "kmdyomkxfbvfbh")) - .withDefaultIsolationId("i"); - model = BinaryData.fromObject(model).toObject(NicDetail.class); - Assertions.assertEquals("vqejosovy", model.adapterName()); - Assertions.assertEquals("leaesi", model.interfaceDescription()); - Assertions.assertEquals("qtljqobbpihehc", model.componentId()); - Assertions.assertEquals("ybmrqbrjbbmp", model.driverVersion()); - Assertions.assertEquals("lvykfrex", model.ip4Address()); - Assertions.assertEquals("s", model.subnetMask()); - Assertions.assertEquals("wjksghudgzhxo", model.defaultGateway()); - Assertions.assertEquals("gsv", model.dnsServers().get(0)); - Assertions.assertEquals("i", model.defaultIsolationId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ObservabilityTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ObservabilityTests.java deleted file mode 100644 index 76605ed40c8e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ObservabilityTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.Observability; -import org.junit.jupiter.api.Assertions; - -public final class ObservabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Observability model - = BinaryData.fromString("{\"streamingDataClient\":false,\"euLocation\":true,\"episodicDataUpload\":true}") - .toObject(Observability.class); - Assertions.assertEquals(false, model.streamingDataClient()); - Assertions.assertEquals(true, model.euLocation()); - Assertions.assertEquals(true, model.episodicDataUpload()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Observability model - = new Observability().withStreamingDataClient(false).withEuLocation(true).withEpisodicDataUpload(true); - model = BinaryData.fromObject(model).toObject(Observability.class); - Assertions.assertEquals(false, model.streamingDataClient()); - Assertions.assertEquals(true, model.euLocation()); - Assertions.assertEquals(true, model.episodicDataUpload()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferInnerTests.java deleted file mode 100644 index ba5be3e40205..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferInnerTests.java +++ /dev/null @@ -1,50 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; -import com.azure.resourcemanager.azurestackhci.models.SkuMappings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OfferInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OfferInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"yavluwmncstt\",\"publisherId\":\"fybvpoek\",\"content\":\"gsgbdhuzq\",\"contentVersion\":\"j\",\"skuMappings\":[{\"catalogPlanId\":\"nscliqhzvhxnk\",\"marketplaceSkuId\":\"tkubotppn\",\"marketplaceSkuVersions\":[\"zxhi\"]},{\"catalogPlanId\":\"rbbcevq\",\"marketplaceSkuId\":\"tltdhlfkqojpy\",\"marketplaceSkuVersions\":[\"trdcnifmzzs\"]},{\"catalogPlanId\":\"m\",\"marketplaceSkuId\":\"nysuxmprafwgckh\",\"marketplaceSkuVersions\":[\"vdff\"]}]},\"id\":\"afqr\",\"name\":\"udaspavehh\",\"type\":\"vkbunzozudh\"}") - .toObject(OfferInner.class); - Assertions.assertEquals("fybvpoek", model.publisherId()); - Assertions.assertEquals("gsgbdhuzq", model.content()); - Assertions.assertEquals("j", model.contentVersion()); - Assertions.assertEquals("nscliqhzvhxnk", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("tkubotppn", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("zxhi", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OfferInner model = new OfferInner().withPublisherId("fybvpoek") - .withContent("gsgbdhuzq") - .withContentVersion("j") - .withSkuMappings(Arrays.asList( - new SkuMappings().withCatalogPlanId("nscliqhzvhxnk") - .withMarketplaceSkuId("tkubotppn") - .withMarketplaceSkuVersions(Arrays.asList("zxhi")), - new SkuMappings().withCatalogPlanId("rbbcevq") - .withMarketplaceSkuId("tltdhlfkqojpy") - .withMarketplaceSkuVersions(Arrays.asList("trdcnifmzzs")), - new SkuMappings().withCatalogPlanId("m") - .withMarketplaceSkuId("nysuxmprafwgckh") - .withMarketplaceSkuVersions(Arrays.asList("vdff")))); - model = BinaryData.fromObject(model).toObject(OfferInner.class); - Assertions.assertEquals("fybvpoek", model.publisherId()); - Assertions.assertEquals("gsgbdhuzq", model.content()); - Assertions.assertEquals("j", model.contentVersion()); - Assertions.assertEquals("nscliqhzvhxnk", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("tkubotppn", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("zxhi", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferListTests.java deleted file mode 100644 index f07e15ef2f51..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferListTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.OfferList; - -public final class OfferListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OfferList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"oxyhkxgqddrihpf\",\"publisherId\":\"qcaaewdaomdjvl\",\"content\":\"x\",\"contentVersion\":\"zb\",\"skuMappings\":[{\"catalogPlanId\":\"eivsiykzkdnc\",\"marketplaceSkuId\":\"xonbzoggculapz\",\"marketplaceSkuVersions\":[\"pgogtqxepny\",\"b\",\"uajlyj\"]},{\"catalogPlanId\":\"vofqzhvfc\",\"marketplaceSkuId\":\"yfm\",\"marketplaceSkuVersions\":[\"xrkjpvdw\",\"fzwiivwzjbhyz\"]}]},\"id\":\"jrkambtrnegvmnv\",\"name\":\"q\",\"type\":\"qvldspastjbkkd\"},{\"properties\":{\"provisioningState\":\"vestmjl\",\"publisherId\":\"ril\",\"content\":\"apeewchpxlkt\",\"contentVersion\":\"uziycsl\",\"skuMappings\":[{\"catalogPlanId\":\"uztcktyhjtqed\",\"marketplaceSkuId\":\"zulwmmrqzzrrj\",\"marketplaceSkuVersions\":[\"lydzgk\"]},{\"catalogPlanId\":\"qeevt\",\"marketplaceSkuId\":\"pryu\",\"marketplaceSkuVersions\":[\"ytp\",\"dmovzvfva\",\"wzqa\"]},{\"catalogPlanId\":\"lgzurig\",\"marketplaceSkuId\":\"ecxn\",\"marketplaceSkuVersions\":[\"cokpv\",\"mlqtmldgxob\"]},{\"catalogPlanId\":\"rclnpkc\",\"marketplaceSkuId\":\"yzriykhy\",\"marketplaceSkuVersions\":[\"vjlboxqvk\",\"lmxhomdyn\",\"dwdigumb\",\"raauzzpt\"]}]},\"id\":\"zysdzh\",\"name\":\"zwwva\",\"type\":\"qyuvvfonkp\"}],\"nextLink\":\"qyikvy\"}") - .toObject(OfferList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OfferList model = new OfferList(); - model = BinaryData.fromObject(model).toObject(OfferList.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferPropertiesTests.java deleted file mode 100644 index 7d383cd7e65b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OfferPropertiesTests.java +++ /dev/null @@ -1,51 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.OfferProperties; -import com.azure.resourcemanager.azurestackhci.models.SkuMappings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OfferPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OfferProperties model = BinaryData.fromString( - "{\"provisioningState\":\"gkmoyxcdyuibhmfd\",\"publisherId\":\"zydvfvf\",\"content\":\"naeo\",\"contentVersion\":\"rvhmgor\",\"skuMappings\":[{\"catalogPlanId\":\"is\",\"marketplaceSkuId\":\"w\",\"marketplaceSkuVersions\":[\"wplefaxvxil\",\"btgn\",\"nzeyqxtjj\"]},{\"catalogPlanId\":\"qlqhycavodg\",\"marketplaceSkuId\":\"dbeesmie\",\"marketplaceSkuVersions\":[\"ra\",\"iaa\",\"iuagydwqfbylyrfg\"]},{\"catalogPlanId\":\"gtcojocqwo\",\"marketplaceSkuId\":\"nzjvusfzldm\",\"marketplaceSkuVersions\":[\"xylfsb\",\"kadpysown\",\"tgkbugrjqctojc\",\"isofieypefojyqd\"]}]}") - .toObject(OfferProperties.class); - Assertions.assertEquals("zydvfvf", model.publisherId()); - Assertions.assertEquals("naeo", model.content()); - Assertions.assertEquals("rvhmgor", model.contentVersion()); - Assertions.assertEquals("is", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("w", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("wplefaxvxil", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OfferProperties model = new OfferProperties().withPublisherId("zydvfvf") - .withContent("naeo") - .withContentVersion("rvhmgor") - .withSkuMappings(Arrays.asList( - new SkuMappings().withCatalogPlanId("is") - .withMarketplaceSkuId("w") - .withMarketplaceSkuVersions(Arrays.asList("wplefaxvxil", "btgn", "nzeyqxtjj")), - new SkuMappings().withCatalogPlanId("qlqhycavodg") - .withMarketplaceSkuId("dbeesmie") - .withMarketplaceSkuVersions(Arrays.asList("ra", "iaa", "iuagydwqfbylyrfg")), - new SkuMappings().withCatalogPlanId("gtcojocqwo") - .withMarketplaceSkuId("nzjvusfzldm") - .withMarketplaceSkuVersions( - Arrays.asList("xylfsb", "kadpysown", "tgkbugrjqctojc", "isofieypefojyqd")))); - model = BinaryData.fromObject(model).toObject(OfferProperties.class); - Assertions.assertEquals("zydvfvf", model.publisherId()); - Assertions.assertEquals("naeo", model.content()); - Assertions.assertEquals("rvhmgor", model.contentVersion()); - Assertions.assertEquals("is", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("w", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("wplefaxvxil", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetWithResponseMockTests.java deleted file mode 100644 index c1cb5baf8745..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Offer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OffersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"muqohh\",\"publisherId\":\"raxq\",\"content\":\"drwjcljbrhlh\",\"contentVersion\":\"zadbwe\",\"skuMappings\":[{\"catalogPlanId\":\"afhxrzfrmvztiuc\",\"marketplaceSkuId\":\"iql\",\"marketplaceSkuVersions\":[\"hkrcqx\",\"cbvzarmqcb\"]},{\"catalogPlanId\":\"kst\",\"marketplaceSkuId\":\"nvago\",\"marketplaceSkuVersions\":[\"hdrx\",\"rdvcehqwhit\"]},{\"catalogPlanId\":\"mxgnmguzbuwv\",\"marketplaceSkuId\":\"balkjnbkbdhl\",\"marketplaceSkuVersions\":[\"stqkqsygxiyn\"]}]},\"id\":\"ovagzkheuban\",\"name\":\"xunpqcckqiawzlz\",\"type\":\"laslgacizux\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Offer response = manager.offers() - .getWithResponse("kakvlbishjvpza", "tuoska", "izjixwfgcd", "y", "kcxwnujvqynvavi", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("raxq", response.publisherId()); - Assertions.assertEquals("drwjcljbrhlh", response.content()); - Assertions.assertEquals("zadbwe", response.contentVersion()); - Assertions.assertEquals("afhxrzfrmvztiuc", response.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("iql", response.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("hkrcqx", response.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterMockTests.java deleted file mode 100644 index 82f5cffc2fdf..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Offer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OffersListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"pdjtaqh\",\"publisherId\":\"q\",\"content\":\"pdgonjhxs\",\"contentVersion\":\"hmgpczqulpt\",\"skuMappings\":[{\"catalogPlanId\":\"pxtzhigqqbtimpk\",\"marketplaceSkuId\":\"lornsihqh\",\"marketplaceSkuVersions\":[\"musuaawja\",\"xwjnfcz\",\"nniixyxvqba\"]},{\"catalogPlanId\":\"sjtgirnbgmgmddo\",\"marketplaceSkuId\":\"mynltwmpftmfoeaj\",\"marketplaceSkuVersions\":[\"yxwe\",\"amfdd\",\"vlkpzwb\"]},{\"catalogPlanId\":\"recchdidrmu\",\"marketplaceSkuId\":\"ahmjedbiu\",\"marketplaceSkuVersions\":[\"hhwmjpjbweunxcq\",\"rihufoihppiybxv\"]},{\"catalogPlanId\":\"zuzpbgkzcs\",\"marketplaceSkuId\":\"iuzvkunhdimju\",\"marketplaceSkuVersions\":[\"r\",\"kaugpucdocfqplwg\",\"f\"]}]},\"id\":\"xwr\",\"name\":\"lvzkl\",\"type\":\"vbgikyj\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.offers().listByCluster("xi", "mlnfyz", "vfrbypic", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("q", response.iterator().next().publisherId()); - Assertions.assertEquals("pdgonjhxs", response.iterator().next().content()); - Assertions.assertEquals("hmgpczqulpt", response.iterator().next().contentVersion()); - Assertions.assertEquals("pxtzhigqqbtimpk", response.iterator().next().skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("lornsihqh", response.iterator().next().skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("musuaawja", - response.iterator().next().skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherMockTests.java deleted file mode 100644 index 70fe4833cfad..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Offer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OffersListByPublisherMockTests { - @Test - public void testListByPublisher() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"db\",\"publisherId\":\"kszanmhwgpte\",\"content\":\"iuwkirkskwzts\",\"contentVersion\":\"tjygowifc\",\"skuMappings\":[{\"catalogPlanId\":\"zkgysdgzyybzoxlv\",\"marketplaceSkuId\":\"ptvdxxheigm\",\"marketplaceSkuVersions\":[\"wzghjhjv\",\"abzzbwaybfmdafb\"]},{\"catalogPlanId\":\"mqtnap\",\"marketplaceSkuId\":\"ojxrjnbsconxavi\",\"marketplaceSkuVersions\":[\"yc\",\"bjizqfsgn\"]}]},\"id\":\"xz\",\"name\":\"dpq\",\"type\":\"rfbo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.offers() - .listByPublisher("lfdxaglz", "ytlbtlqhopxouvm", "siflikyypzkgxf", "fmy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kszanmhwgpte", response.iterator().next().publisherId()); - Assertions.assertEquals("iuwkirkskwzts", response.iterator().next().content()); - Assertions.assertEquals("tjygowifc", response.iterator().next().contentVersion()); - Assertions.assertEquals("zkgysdgzyybzoxlv", response.iterator().next().skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("ptvdxxheigm", response.iterator().next().skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("wzghjhjv", - response.iterator().next().skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationDisplayTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationDisplayTests.java deleted file mode 100644 index a8650098e7ff..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"vkcdmxzr\",\"resource\":\"aimlnwiaaom\",\"operation\":\"weazul\",\"description\":\"ethwwnpjhlfz\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultInnerTests.java deleted file mode 100644 index d90327c353c6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultInnerTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; - -public final class OperationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResultInner model = BinaryData.fromString( - "{\"value\":[{\"name\":\"qvgqouw\",\"isDataAction\":false,\"display\":{\"provider\":\"j\",\"resource\":\"ivqikfxcvhr\",\"operation\":\"phuagrttikteusq\",\"description\":\"kvyklxubyjaffmm\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"u\",\"isDataAction\":true,\"display\":{\"provider\":\"brta\",\"resource\":\"etttwgdslqxihhr\",\"operation\":\"oi\",\"description\":\"seypxiutcxapz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"o\",\"isDataAction\":false,\"display\":{\"provider\":\"xslhvnhlabrqnkk\",\"resource\":\"cjbtrgaehvvib\",\"operation\":\"jj\",\"description\":\"oqbeitpkxzt\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"ft\"}") - .toObject(OperationListResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResultInner model = new OperationListResultInner(); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationTests.java deleted file mode 100644 index 44ebb587326f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.Operation; -import com.azure.resourcemanager.azurestackhci.models.OperationDisplay; - -public final class OperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Operation model = BinaryData.fromString( - "{\"name\":\"gfcwqmpimaqxzhem\",\"isDataAction\":false,\"display\":{\"provider\":\"uj\",\"resource\":\"t\",\"operation\":\"ozzwculkba\",\"description\":\"fajnjwltlwtjjguk\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(Operation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(Operation.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListWithResponseMockTests.java deleted file mode 100644 index d81214e5d119..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.OperationListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"wp\",\"isDataAction\":true,\"display\":{\"provider\":\"doejtighsxjpyt\",\"resource\":\"qbalahovuuwxhme\",\"operation\":\"nhjiotiffb\",\"description\":\"ngkegxcypxbbfe\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"zox\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response - = manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OptionalServicesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OptionalServicesTests.java deleted file mode 100644 index 2750fa905b3f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OptionalServicesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.OptionalServices; -import org.junit.jupiter.api.Assertions; - -public final class OptionalServicesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OptionalServices model - = BinaryData.fromString("{\"customLocation\":\"fouyf\"}").toObject(OptionalServices.class); - Assertions.assertEquals("fouyf", model.customLocation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OptionalServices model = new OptionalServices().withCustomLocation("fouyf"); - model = BinaryData.fromObject(model).toObject(OptionalServices.class); - Assertions.assertEquals("fouyf", model.customLocation()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PackageVersionInfoTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PackageVersionInfoTests.java deleted file mode 100644 index 2366524f43af..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PackageVersionInfoTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PackageVersionInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PackageVersionInfo model = BinaryData - .fromString( - "{\"packageType\":\"dfzantkwcegy\",\"version\":\"lbnseqac\",\"lastUpdated\":\"2021-04-09T20:59:15Z\"}") - .toObject(PackageVersionInfo.class); - Assertions.assertEquals("dfzantkwcegy", model.packageType()); - Assertions.assertEquals("lbnseqac", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T20:59:15Z"), model.lastUpdated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PackageVersionInfo model = new PackageVersionInfo().withPackageType("dfzantkwcegy") - .withVersion("lbnseqac") - .withLastUpdated(OffsetDateTime.parse("2021-04-09T20:59:15Z")); - model = BinaryData.fromObject(model).toObject(PackageVersionInfo.class); - Assertions.assertEquals("dfzantkwcegy", model.packageType()); - Assertions.assertEquals("lbnseqac", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T20:59:15Z"), model.lastUpdated()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeRemoteSupportSessionTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeRemoteSupportSessionTests.java deleted file mode 100644 index 14754b3e3280..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeRemoteSupportSessionTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.PerNodeRemoteSupportSession; - -public final class PerNodeRemoteSupportSessionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PerNodeRemoteSupportSession model = BinaryData.fromString( - "{\"sessionStartTime\":\"2021-06-21T03:22:31Z\",\"sessionEndTime\":\"2021-02-04T14:03:28Z\",\"nodeName\":\"axibxujw\",\"duration\":6825122128576329936,\"accessLevel\":\"Diagnostics\"}") - .toObject(PerNodeRemoteSupportSession.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PerNodeRemoteSupportSession model = new PerNodeRemoteSupportSession(); - model = BinaryData.fromObject(model).toObject(PerNodeRemoteSupportSession.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeStateTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeStateTests.java deleted file mode 100644 index e0f1b5e483ef..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PerNodeStateTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.PerNodeState; - -public final class PerNodeStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PerNodeState model = BinaryData.fromString( - "{\"name\":\"hurokftyxoln\",\"arcInstance\":\"pwcukjfkgiawxk\",\"arcNodeServicePrincipalObjectId\":\"ypl\",\"state\":\"Succeeded\"}") - .toObject(PerNodeState.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PerNodeState model = new PerNodeState(); - model = BinaryData.fromObject(model).toObject(PerNodeState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PhysicalNodesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PhysicalNodesTests.java deleted file mode 100644 index 688f0c7d8cfc..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PhysicalNodesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.PhysicalNodes; -import org.junit.jupiter.api.Assertions; - -public final class PhysicalNodesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PhysicalNodes model - = BinaryData.fromString("{\"name\":\"eqx\",\"ipv4Address\":\"z\"}").toObject(PhysicalNodes.class); - Assertions.assertEquals("eqx", model.name()); - Assertions.assertEquals("z", model.ipv4Address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PhysicalNodes model = new PhysicalNodes().withName("eqx").withIpv4Address("z"); - model = BinaryData.fromObject(model).toObject(PhysicalNodes.class); - Assertions.assertEquals("eqx", model.name()); - Assertions.assertEquals("z", model.ipv4Address()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherInnerTests.java deleted file mode 100644 index 43f7932806a9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherInnerTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; - -public final class PublisherInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"ijr\"},\"id\":\"civmmg\",\"name\":\"f\",\"type\":\"fiwrxgkn\"}") - .toObject(PublisherInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherInner model = new PublisherInner(); - model = BinaryData.fromObject(model).toObject(PublisherInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherListTests.java deleted file mode 100644 index 77c4e3fdb0ac..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherListTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.PublisherList; - -public final class PublisherListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"wahfbousnfepgfew\"},\"id\":\"wlyxgncxyk\",\"name\":\"hdjhlimmbcx\",\"type\":\"h\"},{\"properties\":{\"provisioningState\":\"orxvxcjzhqiz\"},\"id\":\"pxtgqscjav\",\"name\":\"t\",\"type\":\"uhdqazk\"}],\"nextLink\":\"gg\"}") - .toObject(PublisherList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherList model = new PublisherList(); - model = BinaryData.fromObject(model).toObject(PublisherList.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherPropertiesTests.java deleted file mode 100644 index 59549ca25729..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublisherPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherProperties; - -public final class PublisherPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherProperties model - = BinaryData.fromString("{\"provisioningState\":\"vyi\"}").toObject(PublisherProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherProperties model = new PublisherProperties(); - model = BinaryData.fromObject(model).toObject(PublisherProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetWithResponseMockTests.java deleted file mode 100644 index 5bb05e38d574..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Publisher; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PublishersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"pfuofixcnpcfykkp\"},\"id\":\"cpawmp\",\"name\":\"prdpwrpc\",\"type\":\"pcf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Publisher response = manager.publishers() - .getWithResponse("eajczxvlgsrgkr", "izrpywlptyuqhrl", "cs", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterMockTests.java deleted file mode 100644 index 743726d7c9f7..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Publisher; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PublishersListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"jew\"},\"id\":\"hwkxjjmztnl\",\"name\":\"soodtmvecdhdy\",\"type\":\"wcrpt\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.publishers().listByCluster("dxqlfrolq", "wnk", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/QosPolicyOverridesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/QosPolicyOverridesTests.java deleted file mode 100644 index ff6597890dfc..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/QosPolicyOverridesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.QosPolicyOverrides; -import org.junit.jupiter.api.Assertions; - -public final class QosPolicyOverridesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QosPolicyOverrides model = BinaryData.fromString( - "{\"priorityValue8021Action_Cluster\":\"ohdneuel\",\"priorityValue8021Action_SMB\":\"hsd\",\"bandwidthPercentage_SMB\":\"t\"}") - .toObject(QosPolicyOverrides.class); - Assertions.assertEquals("ohdneuel", model.priorityValue8021ActionCluster()); - Assertions.assertEquals("hsd", model.priorityValue8021ActionSmb()); - Assertions.assertEquals("t", model.bandwidthPercentageSmb()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QosPolicyOverrides model = new QosPolicyOverrides().withPriorityValue8021ActionCluster("ohdneuel") - .withPriorityValue8021ActionSmb("hsd") - .withBandwidthPercentageSmb("t"); - model = BinaryData.fromObject(model).toObject(QosPolicyOverrides.class); - Assertions.assertEquals("ohdneuel", model.priorityValue8021ActionCluster()); - Assertions.assertEquals("hsd", model.priorityValue8021ActionSmb()); - Assertions.assertEquals("t", model.bandwidthPercentageSmb()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RawCertificateDataTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RawCertificateDataTests.java deleted file mode 100644 index 1029247a84af..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RawCertificateDataTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RawCertificateDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RawCertificateData model = BinaryData.fromString("{\"certificates\":[\"qhakauhashsf\",\"xosow\",\"xcug\"]}") - .toObject(RawCertificateData.class); - Assertions.assertEquals("qhakauhashsf", model.certificates().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RawCertificateData model - = new RawCertificateData().withCertificates(Arrays.asList("qhakauhashsf", "xosow", "xcug")); - model = BinaryData.fromObject(model).toObject(RawCertificateData.class); - Assertions.assertEquals("qhakauhashsf", model.certificates().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportNodeSettingsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportNodeSettingsTests.java deleted file mode 100644 index 1c7db17a91aa..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportNodeSettingsTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportNodeSettings; - -public final class RemoteSupportNodeSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteSupportNodeSettings model = BinaryData.fromString( - "{\"arcResourceId\":\"xdbabphlwr\",\"state\":\"fkts\",\"createdAt\":\"2021-03-16T19:30:33Z\",\"updatedAt\":\"2021-11-18T02:17:24Z\",\"connectionStatus\":\"cmnyyazttb\",\"connectionErrorMessage\":\"wrqpue\",\"transcriptLocation\":\"kzywbiex\"}") - .toObject(RemoteSupportNodeSettings.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteSupportNodeSettings model = new RemoteSupportNodeSettings(); - model = BinaryData.fromObject(model).toObject(RemoteSupportNodeSettings.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportPropertiesTests.java deleted file mode 100644 index 953be0e12f30..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportPropertiesTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties; - -public final class RemoteSupportPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteSupportProperties model = BinaryData.fromString( - "{\"accessLevel\":\"Diagnostics\",\"expirationTimeStamp\":\"2021-06-19T07:11:27Z\",\"remoteSupportType\":\"Revoke\",\"remoteSupportNodeSettings\":[{\"arcResourceId\":\"xbf\",\"state\":\"xnehmpvec\",\"createdAt\":\"2021-06-15T22:18:20Z\",\"updatedAt\":\"2020-12-30T00:43:07Z\",\"connectionStatus\":\"fqkkr\",\"connectionErrorMessage\":\"pukgriwflzlfb\",\"transcriptLocation\":\"puz\"},{\"arcResourceId\":\"ispnqzahmgkbrp\",\"state\":\"dhibnuq\",\"createdAt\":\"2021-03-15T23:25:16Z\",\"updatedAt\":\"2021-01-19T19:26:18Z\",\"connectionStatus\":\"drgvtqagn\",\"connectionErrorMessage\":\"ynhijggme\",\"transcriptLocation\":\"siarbutrcvpn\"}],\"remoteSupportSessionDetails\":[{\"sessionStartTime\":\"2021-07-19T14:05:18Z\",\"sessionEndTime\":\"2021-10-18T23:40:33Z\",\"nodeName\":\"nmpxttdb\",\"duration\":5309093572451246570,\"accessLevel\":\"DiagnosticsAndRepair\"},{\"sessionStartTime\":\"2020-12-22T00:49:35Z\",\"sessionEndTime\":\"2021-12-08T10:55:15Z\",\"nodeName\":\"skpbhenbtkcxywn\",\"duration\":3361050620024364671,\"accessLevel\":\"Diagnostics\"},{\"sessionStartTime\":\"2021-08-18T06:48:11Z\",\"sessionEndTime\":\"2021-11-13T00:34:54Z\",\"nodeName\":\"ybyxc\",\"duration\":3688624800948339893,\"accessLevel\":\"DiagnosticsAndRepair\"}]}") - .toObject(RemoteSupportProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteSupportProperties model = new RemoteSupportProperties(); - model = BinaryData.fromObject(model).toObject(RemoteSupportProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestPropertiesTests.java deleted file mode 100644 index a07e7bc02370..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class RemoteSupportRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteSupportRequestProperties model = BinaryData.fromString( - "{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-09-05T17:35:53Z\",\"remoteSupportType\":\"Enable\"}") - .toObject(RemoteSupportRequestProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T17:35:53Z"), model.expirationTimestamp()); - Assertions.assertEquals(RemoteSupportType.ENABLE, model.remoteSupportType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteSupportRequestProperties model - = new RemoteSupportRequestProperties().withExpirationTimestamp(OffsetDateTime.parse("2021-09-05T17:35:53Z")) - .withRemoteSupportType(RemoteSupportType.ENABLE); - model = BinaryData.fromObject(model).toObject(RemoteSupportRequestProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T17:35:53Z"), model.expirationTimestamp()); - Assertions.assertEquals(RemoteSupportType.ENABLE, model.remoteSupportType()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestTests.java deleted file mode 100644 index 5c9bb76ed90d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RemoteSupportRequestTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequest; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.RemoteSupportType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class RemoteSupportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteSupportRequest model = BinaryData.fromString( - "{\"properties\":{\"accessLevel\":\"DiagnosticsAndRepair\",\"expirationTimeStamp\":\"2021-03-18T15:51:25Z\",\"remoteSupportType\":\"Enable\"}}") - .toObject(RemoteSupportRequest.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T15:51:25Z"), model.properties().expirationTimestamp()); - Assertions.assertEquals(RemoteSupportType.ENABLE, model.properties().remoteSupportType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteSupportRequest model = new RemoteSupportRequest().withProperties( - new RemoteSupportRequestProperties().withExpirationTimestamp(OffsetDateTime.parse("2021-03-18T15:51:25Z")) - .withRemoteSupportType(RemoteSupportType.ENABLE)); - model = BinaryData.fromObject(model).toObject(RemoteSupportRequest.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T15:51:25Z"), model.properties().expirationTimestamp()); - Assertions.assertEquals(RemoteSupportType.ENABLE, model.properties().remoteSupportType()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ReportedPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ReportedPropertiesTests.java deleted file mode 100644 index 46db0d0bc1ad..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ReportedPropertiesTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ReportedProperties; - -public final class ReportedPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReportedProperties model = BinaryData.fromString( - "{\"deviceState\":\"InMaintenance\",\"extensionProfile\":{\"extensions\":[{\"extensionName\":\"iuas\",\"state\":\"Updating\",\"errorDetails\":[{\"exception\":\"ocnequygdjboqgrm\"},{\"exception\":\"jkqev\"},{\"exception\":\"rmmwiuawvcmj\"},{\"exception\":\"xiid\"}],\"extensionResourceId\":\"czskoswoqiqazu\",\"typeHandlerVersion\":\"mxzkr\",\"managedBy\":\"Azure\"}]}}") - .toObject(ReportedProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReportedProperties model = new ReportedProperties(); - model = BinaryData.fromObject(model).toObject(ReportedProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbeDeploymentInfoTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbeDeploymentInfoTests.java deleted file mode 100644 index f6cf1f78f33c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbeDeploymentInfoTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SbeDeploymentInfo; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SbeDeploymentInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SbeDeploymentInfo model = BinaryData.fromString( - "{\"version\":\"bcuejrjxgci\",\"family\":\"brh\",\"publisher\":\"xsdqrhzoymibmrqy\",\"sbeManifestSource\":\"ahwfluszdtmhrk\",\"sbeManifestCreationDate\":\"2021-06-28T13:04:58Z\"}") - .toObject(SbeDeploymentInfo.class); - Assertions.assertEquals("bcuejrjxgci", model.version()); - Assertions.assertEquals("brh", model.family()); - Assertions.assertEquals("xsdqrhzoymibmrqy", model.publisher()); - Assertions.assertEquals("ahwfluszdtmhrk", model.sbeManifestSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T13:04:58Z"), model.sbeManifestCreationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SbeDeploymentInfo model = new SbeDeploymentInfo().withVersion("bcuejrjxgci") - .withFamily("brh") - .withPublisher("xsdqrhzoymibmrqy") - .withSbeManifestSource("ahwfluszdtmhrk") - .withSbeManifestCreationDate(OffsetDateTime.parse("2021-06-28T13:04:58Z")); - model = BinaryData.fromObject(model).toObject(SbeDeploymentInfo.class); - Assertions.assertEquals("bcuejrjxgci", model.version()); - Assertions.assertEquals("brh", model.family()); - Assertions.assertEquals("xsdqrhzoymibmrqy", model.publisher()); - Assertions.assertEquals("ahwfluszdtmhrk", model.sbeManifestSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T13:04:58Z"), model.sbeManifestCreationDate()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbePartnerPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbePartnerPropertiesTests.java deleted file mode 100644 index 2842b0fb2f9b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SbePartnerPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SbePartnerProperties; -import org.junit.jupiter.api.Assertions; - -public final class SbePartnerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SbePartnerProperties model = BinaryData.fromString("{\"name\":\"yvoqa\",\"value\":\"iexpbtgiwbwo\"}") - .toObject(SbePartnerProperties.class); - Assertions.assertEquals("yvoqa", model.name()); - Assertions.assertEquals("iexpbtgiwbwo", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SbePartnerProperties model = new SbePartnerProperties().withName("yvoqa").withValue("iexpbtgiwbwo"); - model = BinaryData.fromObject(model).toObject(SbePartnerProperties.class); - Assertions.assertEquals("yvoqa", model.name()); - Assertions.assertEquals("iexpbtgiwbwo", model.value()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SdnIntegrationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SdnIntegrationTests.java deleted file mode 100644 index 287d109e4289..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SdnIntegrationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.NetworkController; -import com.azure.resourcemanager.azurestackhci.models.SdnIntegration; -import org.junit.jupiter.api.Assertions; - -public final class SdnIntegrationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SdnIntegration model = BinaryData.fromString( - "{\"networkController\":{\"macAddressPoolStart\":\"hjwniyqsluic\",\"macAddressPoolStop\":\"ggkzzlvmbmpa\",\"networkVirtualizationEnabled\":true}}") - .toObject(SdnIntegration.class); - Assertions.assertEquals("hjwniyqsluic", model.networkController().macAddressPoolStart()); - Assertions.assertEquals("ggkzzlvmbmpa", model.networkController().macAddressPoolStop()); - Assertions.assertEquals(true, model.networkController().networkVirtualizationEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SdnIntegration model - = new SdnIntegration().withNetworkController(new NetworkController().withMacAddressPoolStart("hjwniyqsluic") - .withMacAddressPoolStop("ggkzzlvmbmpa") - .withNetworkVirtualizationEnabled(true)); - model = BinaryData.fromObject(model).toObject(SdnIntegration.class); - Assertions.assertEquals("hjwniyqsluic", model.networkController().macAddressPoolStart()); - Assertions.assertEquals("ggkzzlvmbmpa", model.networkController().macAddressPoolStop()); - Assertions.assertEquals(true, model.networkController().networkVirtualizationEnabled()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityComplianceStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityComplianceStatusTests.java deleted file mode 100644 index 5b2a60dea0f6..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityComplianceStatusTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SecurityComplianceStatus; - -public final class SecurityComplianceStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityComplianceStatus model = BinaryData.fromString( - "{\"securedCoreCompliance\":\"Compliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"Pending\",\"dataInTransitProtected\":\"Compliant\",\"lastUpdated\":\"2021-03-28T22:38:24Z\"}") - .toObject(SecurityComplianceStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityComplianceStatus model = new SecurityComplianceStatus(); - model = BinaryData.fromObject(model).toObject(SecurityComplianceStatus.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityPropertiesTests.java deleted file mode 100644 index bcf15b19ee59..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecurityPropertiesTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.SecurityProperties; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class SecurityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityProperties model = BinaryData.fromString( - "{\"securedCoreComplianceAssignment\":\"Audit\",\"wdacComplianceAssignment\":\"ApplyAndAutoCorrect\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"NonCompliant\",\"dataAtRestEncrypted\":\"NonCompliant\",\"dataInTransitProtected\":\"NonCompliant\",\"lastUpdated\":\"2021-03-24T12:08Z\"},\"provisioningState\":\"PartiallyConnected\"}") - .toObject(SecurityProperties.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, model.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.PARTIALLY_CONNECTED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityProperties model - = new SecurityProperties().withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withProvisioningState(ProvisioningState.PARTIALLY_CONNECTED); - model = BinaryData.fromObject(model).toObject(SecurityProperties.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, model.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.PARTIALLY_CONNECTED, model.provisioningState()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingInnerTests.java deleted file mode 100644 index 9f7508e1878a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingInnerTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySettingInner model = BinaryData.fromString( - "{\"properties\":{\"securedCoreComplianceAssignment\":\"Audit\",\"wdacComplianceAssignment\":\"ApplyAndAutoCorrect\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"NonCompliant\",\"dataInTransitProtected\":\"NonCompliant\",\"lastUpdated\":\"2021-05-17T11:48:43Z\"},\"provisioningState\":\"Accepted\"},\"id\":\"zdzgtilaxhnfhqly\",\"name\":\"ijouwivkxoyzunb\",\"type\":\"xxrtikvc\"}") - .toObject(SecuritySettingInner.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, model.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySettingInner model - = new SecuritySettingInner().withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withProvisioningState(ProvisioningState.ACCEPTED); - model = BinaryData.fromObject(model).toObject(SecuritySettingInner.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, model.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingListResultTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingListResultTests.java deleted file mode 100644 index b75f3e4ce4df..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingListResultTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.SecuritySettingListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySettingListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySettingListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"securedCoreComplianceAssignment\":\"Audit\",\"wdacComplianceAssignment\":\"ApplyAndAutoCorrect\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"Pending\",\"dataInTransitProtected\":\"Compliant\",\"lastUpdated\":\"2021-08-21T03:33:37Z\"},\"provisioningState\":\"Updating\"},\"id\":\"tx\",\"name\":\"zflbqvg\",\"type\":\"qvlgafcqusrdvetn\"},{\"properties\":{\"securedCoreComplianceAssignment\":\"ApplyAndAutoCorrect\",\"wdacComplianceAssignment\":\"ApplyAndAutoCorrect\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"Compliant\",\"dataInTransitProtected\":\"Pending\",\"lastUpdated\":\"2021-11-09T16:30:30Z\"},\"provisioningState\":\"Canceled\"},\"id\":\"ipmve\",\"name\":\"dxukuqgsjjxundxg\",\"type\":\"etw\"},{\"properties\":{\"securedCoreComplianceAssignment\":\"ApplyAndAutoCorrect\",\"wdacComplianceAssignment\":\"Audit\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"ApplyAndAutoCorrect\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Compliant\",\"dataAtRestEncrypted\":\"Compliant\",\"dataInTransitProtected\":\"NonCompliant\",\"lastUpdated\":\"2021-08-10T07:35:10Z\"},\"provisioningState\":\"Deleted\"},\"id\":\"sx\",\"name\":\"mhfbuzjy\",\"type\":\"hsasbhu\"}],\"nextLink\":\"pohyuemslynsqyr\"}") - .toObject(SecuritySettingListResult.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.value().get(0).securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - model.value().get(0).wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.value().get(0).smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("pohyuemslynsqyr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySettingListResult model = new SecuritySettingListResult().withValue(Arrays.asList( - new SecuritySettingInner().withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withProvisioningState(ProvisioningState.UPDATING), - new SecuritySettingInner() - .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withProvisioningState(ProvisioningState.CANCELED), - new SecuritySettingInner() - .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withWdacComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withProvisioningState(ProvisioningState.DELETED))) - .withNextLink("pohyuemslynsqyr"); - model = BinaryData.fromObject(model).toObject(SecuritySettingListResult.class); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, model.value().get(0).securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - model.value().get(0).wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - model.value().get(0).smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("pohyuemslynsqyr", model.nextLink()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateMockTests.java deleted file mode 100644 index 3a7e9d26412e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,52 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.SecuritySetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SecuritySettingsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"securedCoreComplianceAssignment\":\"ApplyAndAutoCorrect\",\"wdacComplianceAssignment\":\"Audit\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"ApplyAndAutoCorrect\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"Pending\",\"wdacCompliance\":\"NonCompliant\",\"dataAtRestEncrypted\":\"NonCompliant\",\"dataInTransitProtected\":\"Compliant\",\"lastUpdated\":\"2021-09-13T11:22:28Z\"},\"provisioningState\":\"Succeeded\"},\"id\":\"cwlisolntfxxcrqm\",\"name\":\"pfjwfo\",\"type\":\"gizmshxxbaizabu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySetting response = manager.securitySettings() - .define("ihezomucmq") - .withExistingCluster("k", "kzkdtzxsoednlwg") - .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) - .withWdacComplianceAssignment(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withSmbEncryptionForIntraClusterTrafficComplianceAssignment( - ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT) - .withProvisioningState(ProvisioningState.CREATING) - .create(); - - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - response.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, response.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - response.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.provisioningState()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetWithResponseMockTests.java deleted file mode 100644 index 41e233c7b453..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.SecuritySetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SecuritySettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"securedCoreComplianceAssignment\":\"ApplyAndAutoCorrect\",\"wdacComplianceAssignment\":\"Audit\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"NonCompliant\",\"dataInTransitProtected\":\"NonCompliant\",\"lastUpdated\":\"2021-02-09T04:05:24Z\"},\"provisioningState\":\"Deleting\"},\"id\":\"hcxnwjtpfdzxco\",\"name\":\"z\",\"type\":\"wofw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySetting response = manager.securitySettings() - .getWithResponse("n", "ynts", "jmfmeftvhkm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - response.securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, response.wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - response.smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.DELETING, response.provisioningState()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersMockTests.java deleted file mode 100644 index 21adae0f5c22..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.SecuritySetting; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SecuritySettingsListByClustersMockTests { - @Test - public void testListByClusters() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"securedCoreComplianceAssignment\":\"ApplyAndAutoCorrect\",\"wdacComplianceAssignment\":\"Audit\",\"smbEncryptionForIntraClusterTrafficComplianceAssignment\":\"Audit\",\"securityComplianceStatus\":{\"securedCoreCompliance\":\"NonCompliant\",\"wdacCompliance\":\"Pending\",\"dataAtRestEncrypted\":\"Compliant\",\"dataInTransitProtected\":\"NonCompliant\",\"lastUpdated\":\"2021-01-07T16:23:40Z\"},\"provisioningState\":\"Deleting\"},\"id\":\"hqodv\",\"name\":\"gcnbhcbmjk\",\"type\":\"ti\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securitySettings() - .listByClusters("fwzlgzawkgyepeya", "nnidmdiawpzxk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ComplianceAssignmentType.APPLY_AND_AUTO_CORRECT, - response.iterator().next().securedCoreComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, response.iterator().next().wdacComplianceAssignment()); - Assertions.assertEquals(ComplianceAssignmentType.AUDIT, - response.iterator().next().smbEncryptionForIntraClusterTrafficComplianceAssignment()); - Assertions.assertEquals(ProvisioningState.DELETING, response.iterator().next().provisioningState()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuInnerTests.java deleted file mode 100644 index ba1dc122d5b4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuInnerTests.java +++ /dev/null @@ -1,56 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; -import com.azure.resourcemanager.azurestackhci.models.SkuMappings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"age\",\"publisherId\":\"ulxunsmjbnkpp\",\"offerId\":\"nenlsvxeizzg\",\"content\":\"lnsrmffe\",\"contentVersion\":\"xcktpiymerteeamm\",\"skuMappings\":[{\"catalogPlanId\":\"kk\",\"marketplaceSkuId\":\"ddrtkgdojb\",\"marketplaceSkuVersions\":[\"a\",\"refdee\",\"vecuijpx\"]},{\"catalogPlanId\":\"s\",\"marketplaceSkuId\":\"prtujwsawdd\",\"marketplaceSkuVersions\":[\"abxvi\",\"itvtzeexavo\",\"tfgle\"]},{\"catalogPlanId\":\"m\",\"marketplaceSkuId\":\"bwpypqtgsfjacb\",\"marketplaceSkuVersions\":[\"hxudbxvodht\",\"sirudhzmmesckdlp\"]},{\"catalogPlanId\":\"zrcxfailcfxwmdbo\",\"marketplaceSkuId\":\"fgsftufqob\",\"marketplaceSkuVersions\":[\"nac\",\"cc\"]}]},\"id\":\"nhxk\",\"name\":\"zvytnrzvuljraaer\",\"type\":\"nok\"}") - .toObject(SkuInner.class); - Assertions.assertEquals("ulxunsmjbnkpp", model.publisherId()); - Assertions.assertEquals("nenlsvxeizzg", model.offerId()); - Assertions.assertEquals("lnsrmffe", model.content()); - Assertions.assertEquals("xcktpiymerteeamm", model.contentVersion()); - Assertions.assertEquals("kk", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("ddrtkgdojb", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("a", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuInner model = new SkuInner().withPublisherId("ulxunsmjbnkpp") - .withOfferId("nenlsvxeizzg") - .withContent("lnsrmffe") - .withContentVersion("xcktpiymerteeamm") - .withSkuMappings(Arrays.asList( - new SkuMappings().withCatalogPlanId("kk") - .withMarketplaceSkuId("ddrtkgdojb") - .withMarketplaceSkuVersions(Arrays.asList("a", "refdee", "vecuijpx")), - new SkuMappings().withCatalogPlanId("s") - .withMarketplaceSkuId("prtujwsawdd") - .withMarketplaceSkuVersions(Arrays.asList("abxvi", "itvtzeexavo", "tfgle")), - new SkuMappings().withCatalogPlanId("m") - .withMarketplaceSkuId("bwpypqtgsfjacb") - .withMarketplaceSkuVersions(Arrays.asList("hxudbxvodht", "sirudhzmmesckdlp")), - new SkuMappings().withCatalogPlanId("zrcxfailcfxwmdbo") - .withMarketplaceSkuId("fgsftufqob") - .withMarketplaceSkuVersions(Arrays.asList("nac", "cc")))); - model = BinaryData.fromObject(model).toObject(SkuInner.class); - Assertions.assertEquals("ulxunsmjbnkpp", model.publisherId()); - Assertions.assertEquals("nenlsvxeizzg", model.offerId()); - Assertions.assertEquals("lnsrmffe", model.content()); - Assertions.assertEquals("xcktpiymerteeamm", model.contentVersion()); - Assertions.assertEquals("kk", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("ddrtkgdojb", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("a", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuListTests.java deleted file mode 100644 index b3003a689cbd..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuListTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SkuList; - -public final class SkuListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"skawaoqvmmb\",\"publisherId\":\"qfr\",\"offerId\":\"lkzmegnitgvkxl\",\"content\":\"qdrfegcealzxwhc\",\"contentVersion\":\"symoyq\",\"skuMappings\":[{\"catalogPlanId\":\"gdivbkbxg\",\"marketplaceSkuId\":\"fajuwas\",\"marketplaceSkuVersions\":[\"aeyyg\",\"xakjsqzhzb\"]},{\"catalogPlanId\":\"kgimsidxasic\",\"marketplaceSkuId\":\"yvvjskgfmo\",\"marketplaceSkuVersions\":[\"hpqgatjeaahhvj\"]}]},\"id\":\"na\",\"name\":\"zybbj\",\"type\":\"idjks\"}],\"nextLink\":\"kyxvxevblbjedn\"}") - .toObject(SkuList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuList model = new SkuList(); - model = BinaryData.fromObject(model).toObject(SkuList.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuMappingsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuMappingsTests.java deleted file mode 100644 index 5b738e5cd419..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuMappingsTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SkuMappings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuMappingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuMappings model = BinaryData.fromString( - "{\"catalogPlanId\":\"u\",\"marketplaceSkuId\":\"cp\",\"marketplaceSkuVersions\":[\"khihihlhzds\",\"tzbsrgnowcjhf\",\"mvec\",\"ctxmwoteyowcluq\"]}") - .toObject(SkuMappings.class); - Assertions.assertEquals("u", model.catalogPlanId()); - Assertions.assertEquals("cp", model.marketplaceSkuId()); - Assertions.assertEquals("khihihlhzds", model.marketplaceSkuVersions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuMappings model = new SkuMappings().withCatalogPlanId("u") - .withMarketplaceSkuId("cp") - .withMarketplaceSkuVersions(Arrays.asList("khihihlhzds", "tzbsrgnowcjhf", "mvec", "ctxmwoteyowcluq")); - model = BinaryData.fromObject(model).toObject(SkuMappings.class); - Assertions.assertEquals("u", model.catalogPlanId()); - Assertions.assertEquals("cp", model.marketplaceSkuId()); - Assertions.assertEquals("khihihlhzds", model.marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuPropertiesTests.java deleted file mode 100644 index ebf9f225e80c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkuPropertiesTests.java +++ /dev/null @@ -1,56 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.SkuProperties; -import com.azure.resourcemanager.azurestackhci.models.SkuMappings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuProperties model = BinaryData.fromString( - "{\"provisioningState\":\"ukkjqnvbroyla\",\"publisherId\":\"ulcdisdosf\",\"offerId\":\"jsvg\",\"content\":\"whryvycytdcl\",\"contentVersion\":\"ccknfnwmbtmvp\",\"skuMappings\":[{\"catalogPlanId\":\"httz\",\"marketplaceSkuId\":\"fedxihchrphkm\",\"marketplaceSkuVersions\":[\"dqns\",\"fzpbgtgkyl\",\"dgh\"]},{\"catalogPlanId\":\"euutlwxezwzh\",\"marketplaceSkuId\":\"vbwnhhtq\",\"marketplaceSkuVersions\":[\"hgppipifhpfeoa\",\"vgcxtx\"]},{\"catalogPlanId\":\"sheafid\",\"marketplaceSkuId\":\"ugsresmkssjhoi\",\"marketplaceSkuVersions\":[\"f\",\"fwegprhptillu\",\"biqtgdq\",\"hm\"]},{\"catalogPlanId\":\"sldrizetpwbral\",\"marketplaceSkuId\":\"ibph\",\"marketplaceSkuVersions\":[\"mizak\",\"kan\",\"jpdn\"]}]}") - .toObject(SkuProperties.class); - Assertions.assertEquals("ulcdisdosf", model.publisherId()); - Assertions.assertEquals("jsvg", model.offerId()); - Assertions.assertEquals("whryvycytdcl", model.content()); - Assertions.assertEquals("ccknfnwmbtmvp", model.contentVersion()); - Assertions.assertEquals("httz", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("fedxihchrphkm", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("dqns", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuProperties model = new SkuProperties().withPublisherId("ulcdisdosf") - .withOfferId("jsvg") - .withContent("whryvycytdcl") - .withContentVersion("ccknfnwmbtmvp") - .withSkuMappings(Arrays.asList( - new SkuMappings().withCatalogPlanId("httz") - .withMarketplaceSkuId("fedxihchrphkm") - .withMarketplaceSkuVersions(Arrays.asList("dqns", "fzpbgtgkyl", "dgh")), - new SkuMappings().withCatalogPlanId("euutlwxezwzh") - .withMarketplaceSkuId("vbwnhhtq") - .withMarketplaceSkuVersions(Arrays.asList("hgppipifhpfeoa", "vgcxtx")), - new SkuMappings().withCatalogPlanId("sheafid") - .withMarketplaceSkuId("ugsresmkssjhoi") - .withMarketplaceSkuVersions(Arrays.asList("f", "fwegprhptillu", "biqtgdq", "hm")), - new SkuMappings().withCatalogPlanId("sldrizetpwbral") - .withMarketplaceSkuId("ibph") - .withMarketplaceSkuVersions(Arrays.asList("mizak", "kan", "jpdn")))); - model = BinaryData.fromObject(model).toObject(SkuProperties.class); - Assertions.assertEquals("ulcdisdosf", model.publisherId()); - Assertions.assertEquals("jsvg", model.offerId()); - Assertions.assertEquals("whryvycytdcl", model.content()); - Assertions.assertEquals("ccknfnwmbtmvp", model.contentVersion()); - Assertions.assertEquals("httz", model.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("fedxihchrphkm", model.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("dqns", model.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetWithResponseMockTests.java deleted file mode 100644 index c6e81a4c2e36..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Sku; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SkusGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"upnamglroui\",\"publisherId\":\"mfivjqterd\",\"offerId\":\"igdyd\",\"content\":\"hpcvr\",\"contentVersion\":\"irvt\",\"skuMappings\":[{\"catalogPlanId\":\"hmvfxlapjajodm\",\"marketplaceSkuId\":\"rw\",\"marketplaceSkuVersions\":[\"qvqokql\",\"jqgir\",\"bwlyvxc\"]},{\"catalogPlanId\":\"qvctsfa\",\"marketplaceSkuId\":\"hwwskn\",\"marketplaceSkuVersions\":[\"zuzhasup\",\"lppdpgz\",\"zqazvb\",\"arkptgongruatsyi\"]}]},\"id\":\"jqhenigb\",\"name\":\"qnguba\",\"type\":\"yjdeayscseyd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Sku response = manager.skus() - .getWithResponse("nckidbjpg", "hzqpxzbawkikcdgf", "bssdpjeyoqxd", "decfiwhagxsure", "qrshzzbgullcxiq", - "zjk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("mfivjqterd", response.publisherId()); - Assertions.assertEquals("igdyd", response.offerId()); - Assertions.assertEquals("hpcvr", response.content()); - Assertions.assertEquals("irvt", response.contentVersion()); - Assertions.assertEquals("hmvfxlapjajodm", response.skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("rw", response.skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("qvqokql", response.skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferMockTests.java deleted file mode 100644 index 130a3b463545..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Sku; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SkusListByOfferMockTests { - @Test - public void testListByOffer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"c\",\"publisherId\":\"tfshksnyzm\",\"offerId\":\"amwbwmbnlslcef\",\"content\":\"d\",\"contentVersion\":\"wtkvi\",\"skuMappings\":[{\"catalogPlanId\":\"liwoyngu\",\"marketplaceSkuId\":\"hwvladpc\",\"marketplaceSkuVersions\":[\"hausybkekymffzts\"]},{\"catalogPlanId\":\"sc\",\"marketplaceSkuId\":\"syeiih\",\"marketplaceSkuVersions\":[\"kouihyeseuugcig\",\"hogsmgbvmtd\",\"rqbebjnfveglab\",\"vkbiw\"]}]},\"id\":\"htfgficudyhizpac\",\"name\":\"muhbcakznho\",\"type\":\"hoitwhrjsdmmaz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.skus() - .listByOffer("nvgskjtoxjd", "jsjznv", "xqqm", "i", "aydhf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tfshksnyzm", response.iterator().next().publisherId()); - Assertions.assertEquals("amwbwmbnlslcef", response.iterator().next().offerId()); - Assertions.assertEquals("d", response.iterator().next().content()); - Assertions.assertEquals("wtkvi", response.iterator().next().contentVersion()); - Assertions.assertEquals("liwoyngu", response.iterator().next().skuMappings().get(0).catalogPlanId()); - Assertions.assertEquals("hwvladpc", response.iterator().next().skuMappings().get(0).marketplaceSkuId()); - Assertions.assertEquals("hausybkekymffzts", - response.iterator().next().skuMappings().get(0).marketplaceSkuVersions().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestPropertiesTests.java deleted file mode 100644 index 9d6c3a0cdf13..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestPropertiesTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import org.junit.jupiter.api.Assertions; - -public final class SoftwareAssuranceChangeRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareAssuranceChangeRequestProperties model - = BinaryData.fromString("{\"softwareAssuranceIntent\":\"Enable\"}") - .toObject(SoftwareAssuranceChangeRequestProperties.class); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, model.softwareAssuranceIntent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareAssuranceChangeRequestProperties model = new SoftwareAssuranceChangeRequestProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE); - model = BinaryData.fromObject(model).toObject(SoftwareAssuranceChangeRequestProperties.class); - Assertions.assertEquals(SoftwareAssuranceIntent.ENABLE, model.softwareAssuranceIntent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestTests.java deleted file mode 100644 index 9425352e2697..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssuranceChangeRequestTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import org.junit.jupiter.api.Assertions; - -public final class SoftwareAssuranceChangeRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareAssuranceChangeRequest model - = BinaryData.fromString("{\"properties\":{\"softwareAssuranceIntent\":\"Disable\"}}") - .toObject(SoftwareAssuranceChangeRequest.class); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, model.properties().softwareAssuranceIntent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareAssuranceChangeRequest model - = new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() - .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE)); - model = BinaryData.fromObject(model).toObject(SoftwareAssuranceChangeRequest.class); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, model.properties().softwareAssuranceIntent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssurancePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssurancePropertiesTests.java deleted file mode 100644 index 905c07c54060..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SoftwareAssurancePropertiesTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; -import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; -import org.junit.jupiter.api.Assertions; - -public final class SoftwareAssurancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareAssuranceProperties model = BinaryData.fromString( - "{\"softwareAssuranceStatus\":\"Disabled\",\"softwareAssuranceIntent\":\"Disable\",\"lastUpdated\":\"2021-02-19T02:27:03Z\"}") - .toObject(SoftwareAssuranceProperties.class); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, model.softwareAssuranceIntent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareAssuranceProperties model - = new SoftwareAssuranceProperties().withSoftwareAssuranceIntent(SoftwareAssuranceIntent.DISABLE); - model = BinaryData.fromObject(model).toObject(SoftwareAssuranceProperties.class); - Assertions.assertEquals(SoftwareAssuranceIntent.DISABLE, model.softwareAssuranceIntent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StepTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StepTests.java deleted file mode 100644 index 32662face5b5..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StepTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StepTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Step model = BinaryData.fromString( - "{\"name\":\"kzq\",\"description\":\"jeokbzefezrxccz\",\"errorMessage\":\"tleipqxbkw\",\"status\":\"gnzvdfbzdixzm\",\"startTimeUtc\":\"2021-04-08T06:17:43Z\",\"endTimeUtc\":\"2021-06-28T09:56:46Z\",\"lastUpdatedTimeUtc\":\"2021-11-07T11:06:58Z\",\"expectedExecutionTime\":\"pqhe\",\"steps\":[{\"name\":\"mcgsbostzelnd\",\"description\":\"tutmzl\",\"errorMessage\":\"ojlvfhrbbpneqvc\",\"status\":\"yyurmochpprprsnm\",\"startTimeUtc\":\"2021-07-18T02:05:58Z\",\"endTimeUtc\":\"2021-03-23T11:52:12Z\",\"lastUpdatedTimeUtc\":\"2021-06-08T20:35:44Z\",\"expectedExecutionTime\":\"hlb\",\"steps\":[{\"name\":\"pcpil\",\"description\":\"a\",\"errorMessage\":\"vechndbnwiehole\",\"status\":\"wiuub\",\"startTimeUtc\":\"2021-02-20T13:36:52Z\",\"endTimeUtc\":\"2021-11-19T16:29:04Z\",\"lastUpdatedTimeUtc\":\"2021-04-15T16:55:23Z\",\"expectedExecutionTime\":\"aqtferr\",\"steps\":[{}]},{\"name\":\"jkmfxapjwo\",\"description\":\"qnobp\",\"errorMessage\":\"cdabtqwpwya\",\"status\":\"zasqbucljgkyexao\",\"startTimeUtc\":\"2021-10-16T00:16:04Z\",\"endTimeUtc\":\"2021-04-03T20:50:10Z\",\"lastUpdatedTimeUtc\":\"2021-11-04T08:52:55Z\",\"expectedExecutionTime\":\"sdaultxij\",\"steps\":[{},{}]},{\"name\":\"qwazlnqnmcjngzq\",\"description\":\"xtbjwgnyfusfzsv\",\"errorMessage\":\"ikzhajqglcfhmlrq\",\"status\":\"xynqnz\",\"startTimeUtc\":\"2021-02-04T14:35:25Z\",\"endTimeUtc\":\"2021-03-13T11:56:36Z\",\"lastUpdatedTimeUtc\":\"2021-07-07T00:29:31Z\",\"expectedExecutionTime\":\"zn\",\"steps\":[{},{},{},{}]},{\"name\":\"eiybbabpfhvfsl\",\"description\":\"ntjlr\",\"errorMessage\":\"jkskyr\",\"status\":\"ovzidsx\",\"startTimeUtc\":\"2021-01-26T00:33:40Z\",\"endTimeUtc\":\"2021-08-27T23:16:23Z\",\"lastUpdatedTimeUtc\":\"2021-10-01T04:14:32Z\",\"expectedExecutionTime\":\"ygznmmaxrizk\",\"steps\":[{},{},{}]}]},{\"name\":\"opxlhslnelxieixy\",\"description\":\"lxecwcrojphslh\",\"errorMessage\":\"wjutifdwfmv\",\"status\":\"orq\",\"startTimeUtc\":\"2021-08-10T05:28:35Z\",\"endTimeUtc\":\"2021-05-19T07:51:13Z\",\"lastUpdatedTimeUtc\":\"2021-01-25T09:16:29Z\",\"expectedExecutionTime\":\"glka\",\"steps\":[{\"name\":\"qjujeickpzvcp\",\"description\":\"mxelnwcltyjed\",\"errorMessage\":\"xm\",\"status\":\"mkqscaz\",\"startTimeUtc\":\"2021-02-06T07:38:24Z\",\"endTimeUtc\":\"2021-01-07T08:40:37Z\",\"lastUpdatedTimeUtc\":\"2021-03-23T10:08:45Z\",\"expectedExecutionTime\":\"uamwabzxrvxc\",\"steps\":[{},{},{}]},{\"name\":\"phai\",\"description\":\"xyasflvgsgzw\",\"errorMessage\":\"akoi\",\"status\":\"nsmjbl\",\"startTimeUtc\":\"2021-02-08T01:15:15Z\",\"endTimeUtc\":\"2021-03-04T19:37:05Z\",\"lastUpdatedTimeUtc\":\"2021-08-20T09:09:27Z\",\"expectedExecutionTime\":\"zotqyryuzcb\",\"steps\":[{}]},{\"name\":\"xmvwfg\",\"description\":\"yxonsupe\",\"errorMessage\":\"lzqnhcvs\",\"status\":\"tnzoibgsxgnxfy\",\"startTimeUtc\":\"2021-03-20T13:56:14Z\",\"endTimeUtc\":\"2021-09-28T20:14:38Z\",\"lastUpdatedTimeUtc\":\"2021-06-02T20:10:16Z\",\"expectedExecutionTime\":\"wdofdbxiqx\",\"steps\":[{}]},{\"name\":\"bimhtmwwinhe\",\"description\":\"qpofvwbc\",\"errorMessage\":\"embnkbw\",\"status\":\"vxkdivqihebwtswb\",\"startTimeUtc\":\"2021-01-18T05:52:32Z\",\"endTimeUtc\":\"2021-12-01T16:14:23Z\",\"lastUpdatedTimeUtc\":\"2021-01-09T08:38:51Z\",\"expectedExecutionTime\":\"agegiz\",\"steps\":[{},{},{},{}]}]},{\"name\":\"elisdjub\",\"description\":\"bqigkx\",\"errorMessage\":\"sazgakgacyrcmj\",\"status\":\"spofapvuhry\",\"startTimeUtc\":\"2021-10-23T00:02:47Z\",\"endTimeUtc\":\"2021-02-25T11:36:52Z\",\"lastUpdatedTimeUtc\":\"2021-10-19T06:40:17Z\",\"expectedExecutionTime\":\"bzjedmstk\",\"steps\":[{\"name\":\"xbcuiiznkt\",\"description\":\"ansnvp\",\"errorMessage\":\"bmikost\",\"status\":\"bkiw\",\"startTimeUtc\":\"2021-11-09T06:36:44Z\",\"endTimeUtc\":\"2021-09-12T08:53:09Z\",\"lastUpdatedTimeUtc\":\"2021-11-18T18:14:42Z\",\"expectedExecutionTime\":\"zfylsg\",\"steps\":[{},{},{}]}]},{\"name\":\"bcunezzceze\",\"description\":\"w\",\"errorMessage\":\"wl\",\"status\":\"jwetnpsihcla\",\"startTimeUtc\":\"2021-08-22T14:03:47Z\",\"endTimeUtc\":\"2021-07-30T14:29:46Z\",\"lastUpdatedTimeUtc\":\"2021-01-01T06:51:19Z\",\"expectedExecutionTime\":\"rsqqwztcm\",\"steps\":[{\"name\":\"hcxwaxfewzjk\",\"description\":\"xfdeqvhpsyl\",\"errorMessage\":\"shk\",\"status\":\"f\",\"startTimeUtc\":\"2021-11-21T16:37:11Z\",\"endTimeUtc\":\"2021-04-10T03:24:01Z\",\"lastUpdatedTimeUtc\":\"2021-06-13T14:19:09Z\",\"expectedExecutionTime\":\"ywwpgjxsnptfuj\",\"steps\":[{}]},{\"name\":\"aaoepttaqut\",\"description\":\"wemxswvruunzz\",\"errorMessage\":\"ehkfkimrtixok\",\"status\":\"qyinl\",\"startTimeUtc\":\"2021-11-21T16:22:48Z\",\"endTimeUtc\":\"2021-02-16T03:43:05Z\",\"lastUpdatedTimeUtc\":\"2021-06-20T19:43:14Z\",\"expectedExecutionTime\":\"xmonstshi\",\"steps\":[{},{}]}]}]}") - .toObject(Step.class); - Assertions.assertEquals("kzq", model.name()); - Assertions.assertEquals("jeokbzefezrxccz", model.description()); - Assertions.assertEquals("tleipqxbkw", model.errorMessage()); - Assertions.assertEquals("gnzvdfbzdixzm", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T06:17:43Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T09:56:46Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T11:06:58Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("pqhe", model.expectedExecutionTime()); - Assertions.assertEquals("mcgsbostzelnd", model.steps().get(0).name()); - Assertions.assertEquals("tutmzl", model.steps().get(0).description()); - Assertions.assertEquals("ojlvfhrbbpneqvc", model.steps().get(0).errorMessage()); - Assertions.assertEquals("yyurmochpprprsnm", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T02:05:58Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T11:52:12Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T20:35:44Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("hlb", model.steps().get(0).expectedExecutionTime()); - Assertions.assertEquals("pcpil", model.steps().get(0).steps().get(0).name()); - Assertions.assertEquals("a", model.steps().get(0).steps().get(0).description()); - Assertions.assertEquals("vechndbnwiehole", model.steps().get(0).steps().get(0).errorMessage()); - Assertions.assertEquals("wiuub", model.steps().get(0).steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T13:36:52Z"), - model.steps().get(0).steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T16:29:04Z"), - model.steps().get(0).steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T16:55:23Z"), - model.steps().get(0).steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("aqtferr", model.steps().get(0).steps().get(0).expectedExecutionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Step model - = new Step().withName("kzq") - .withDescription("jeokbzefezrxccz") - .withErrorMessage("tleipqxbkw") - .withStatus("gnzvdfbzdixzm") - .withStartTimeUtc(OffsetDateTime.parse("2021-04-08T06:17:43Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-06-28T09:56:46Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-11-07T11:06:58Z")) - .withExpectedExecutionTime("pqhe") - .withSteps(Arrays.asList( - new Step().withName("mcgsbostzelnd") - .withDescription("tutmzl") - .withErrorMessage("ojlvfhrbbpneqvc") - .withStatus("yyurmochpprprsnm") - .withStartTimeUtc(OffsetDateTime.parse("2021-07-18T02:05:58Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-03-23T11:52:12Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-06-08T20:35:44Z")) - .withExpectedExecutionTime("hlb") - .withSteps( - Arrays - .asList( - new Step().withName("pcpil") - .withDescription("a") - .withErrorMessage("vechndbnwiehole") - .withStatus("wiuub") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-20T13:36:52Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-11-19T16:29:04Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-04-15T16:55:23Z")) - .withExpectedExecutionTime("aqtferr") - .withSteps(Arrays.asList(new Step())), - new Step().withName("jkmfxapjwo") - .withDescription("qnobp") - .withErrorMessage("cdabtqwpwya") - .withStatus("zasqbucljgkyexao") - .withStartTimeUtc(OffsetDateTime.parse("2021-10-16T00:16:04Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-03T20:50:10Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-11-04T08:52:55Z")) - .withExpectedExecutionTime("sdaultxij") - .withSteps(Arrays.asList(new Step(), new Step())), - new Step().withName("qwazlnqnmcjngzq") - .withDescription("xtbjwgnyfusfzsv") - .withErrorMessage("ikzhajqglcfhmlrq") - .withStatus("xynqnz") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-04T14:35:25Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-03-13T11:56:36Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-07-07T00:29:31Z")) - .withExpectedExecutionTime("zn") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())), - new Step() - .withName("eiybbabpfhvfsl") - .withDescription("ntjlr") - .withErrorMessage("jkskyr") - .withStatus("ovzidsx") - .withStartTimeUtc(OffsetDateTime.parse("2021-01-26T00:33:40Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-08-27T23:16:23Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-10-01T04:14:32Z")) - .withExpectedExecutionTime("ygznmmaxrizk") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())))), - new Step().withName("opxlhslnelxieixy") - .withDescription("lxecwcrojphslh") - .withErrorMessage("wjutifdwfmv") - .withStatus("orq") - .withStartTimeUtc(OffsetDateTime.parse("2021-08-10T05:28:35Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-05-19T07:51:13Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-01-25T09:16:29Z")) - .withExpectedExecutionTime("glka") - .withSteps(Arrays.asList( - new Step().withName("qjujeickpzvcp") - .withDescription("mxelnwcltyjed") - .withErrorMessage("xm") - .withStatus("mkqscaz") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-06T07:38:24Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-01-07T08:40:37Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-03-23T10:08:45Z")) - .withExpectedExecutionTime("uamwabzxrvxc") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())), - new Step().withName("phai") - .withDescription("xyasflvgsgzw") - .withErrorMessage("akoi") - .withStatus("nsmjbl") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-08T01:15:15Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-03-04T19:37:05Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-08-20T09:09:27Z")) - .withExpectedExecutionTime("zotqyryuzcb") - .withSteps(Arrays.asList(new Step())), - new Step().withName("xmvwfg") - .withDescription("yxonsupe") - .withErrorMessage("lzqnhcvs") - .withStatus("tnzoibgsxgnxfy") - .withStartTimeUtc(OffsetDateTime.parse("2021-03-20T13:56:14Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-09-28T20:14:38Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-06-02T20:10:16Z")) - .withExpectedExecutionTime("wdofdbxiqx") - .withSteps(Arrays.asList(new Step())), - new Step().withName("bimhtmwwinhe") - .withDescription("qpofvwbc") - .withErrorMessage("embnkbw") - .withStatus("vxkdivqihebwtswb") - .withStartTimeUtc(OffsetDateTime.parse("2021-01-18T05:52:32Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-12-01T16:14:23Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-01-09T08:38:51Z")) - .withExpectedExecutionTime("agegiz") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())))), - new Step().withName("elisdjub") - .withDescription("bqigkx") - .withErrorMessage("sazgakgacyrcmj") - .withStatus("spofapvuhry") - .withStartTimeUtc(OffsetDateTime.parse("2021-10-23T00:02:47Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-02-25T11:36:52Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-10-19T06:40:17Z")) - .withExpectedExecutionTime("bzjedmstk") - .withSteps( - Arrays - .asList( - new Step().withName("xbcuiiznkt") - .withDescription("ansnvp") - .withErrorMessage("bmikost") - .withStatus("bkiw") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-09T06:36:44Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-09-12T08:53:09Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-11-18T18:14:42Z")) - .withExpectedExecutionTime("zfylsg") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())))), - new Step().withName("bcunezzceze") - .withDescription("w") - .withErrorMessage("wl") - .withStatus("jwetnpsihcla") - .withStartTimeUtc(OffsetDateTime.parse("2021-08-22T14:03:47Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-07-30T14:29:46Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-01-01T06:51:19Z")) - .withExpectedExecutionTime("rsqqwztcm") - .withSteps(Arrays.asList( - new Step().withName("hcxwaxfewzjk") - .withDescription("xfdeqvhpsyl") - .withErrorMessage("shk") - .withStatus("f") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-21T16:37:11Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-10T03:24:01Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-06-13T14:19:09Z")) - .withExpectedExecutionTime("ywwpgjxsnptfuj") - .withSteps(Arrays.asList(new Step())), - new Step().withName("aaoepttaqut") - .withDescription("wemxswvruunzz") - .withErrorMessage("ehkfkimrtixok") - .withStatus("qyinl") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-21T16:22:48Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-02-16T03:43:05Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-06-20T19:43:14Z")) - .withExpectedExecutionTime("xmonstshi") - .withSteps(Arrays.asList(new Step(), new Step())))))); - model = BinaryData.fromObject(model).toObject(Step.class); - Assertions.assertEquals("kzq", model.name()); - Assertions.assertEquals("jeokbzefezrxccz", model.description()); - Assertions.assertEquals("tleipqxbkw", model.errorMessage()); - Assertions.assertEquals("gnzvdfbzdixzm", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T06:17:43Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T09:56:46Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T11:06:58Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("pqhe", model.expectedExecutionTime()); - Assertions.assertEquals("mcgsbostzelnd", model.steps().get(0).name()); - Assertions.assertEquals("tutmzl", model.steps().get(0).description()); - Assertions.assertEquals("ojlvfhrbbpneqvc", model.steps().get(0).errorMessage()); - Assertions.assertEquals("yyurmochpprprsnm", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T02:05:58Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T11:52:12Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T20:35:44Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("hlb", model.steps().get(0).expectedExecutionTime()); - Assertions.assertEquals("pcpil", model.steps().get(0).steps().get(0).name()); - Assertions.assertEquals("a", model.steps().get(0).steps().get(0).description()); - Assertions.assertEquals("vechndbnwiehole", model.steps().get(0).steps().get(0).errorMessage()); - Assertions.assertEquals("wiuub", model.steps().get(0).steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T13:36:52Z"), - model.steps().get(0).steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T16:29:04Z"), - model.steps().get(0).steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T16:55:23Z"), - model.steps().get(0).steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("aqtferr", model.steps().get(0).steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageTests.java deleted file mode 100644 index 10264e4c41f7..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = BinaryData.fromString("{\"configurationMode\":\"laulppg\"}").toObject(Storage.class); - Assertions.assertEquals("laulppg", model.configurationMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = new Storage().withConfigurationMode("laulppg"); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals("laulppg", model.configurationMode()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchDetailTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchDetailTests.java deleted file mode 100644 index 0f610e24d52e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchDetailTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SwitchDetail; - -public final class SwitchDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SwitchDetail model = BinaryData.fromString( - "{\"switchName\":\"kzkdhmeott\",\"switchType\":\"jyosxwwh\",\"extensions\":[{\"switchId\":\"fv\",\"extensionName\":\"dpmiljpn\",\"extensionEnabled\":false},{\"switchId\":\"dqllzsauzpjlxeeh\",\"extensionName\":\"iqhzlr\",\"extensionEnabled\":false},{\"switchId\":\"zxlskihmxr\",\"extensionName\":\"sajrednwyysht\",\"extensionEnabled\":true},{\"switchId\":\"evuafpwzyifrk\",\"extensionName\":\"ltxeqip\",\"extensionEnabled\":false}]}") - .toObject(SwitchDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SwitchDetail model = new SwitchDetail(); - model = BinaryData.fromObject(model).toObject(SwitchDetail.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchExtensionTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchExtensionTests.java deleted file mode 100644 index 300c3bd7870a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SwitchExtensionTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.SwitchExtension; - -public final class SwitchExtensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SwitchExtension model - = BinaryData.fromString("{\"switchId\":\"yimsfayorpr\",\"extensionName\":\"kj\",\"extensionEnabled\":true}") - .toObject(SwitchExtension.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SwitchExtension model = new SwitchExtension(); - model = BinaryData.fromObject(model).toObject(SwitchExtension.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateListTests.java deleted file mode 100644 index 8f330e86c91e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateListTests.java +++ /dev/null @@ -1,252 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; -import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; -import com.azure.resourcemanager.azurestackhci.models.HealthState; -import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; -import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; -import com.azure.resourcemanager.azurestackhci.models.PrecheckResultTags; -import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; -import com.azure.resourcemanager.azurestackhci.models.Severity; -import com.azure.resourcemanager.azurestackhci.models.State; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.azure.resourcemanager.azurestackhci.models.UpdateList; -import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateList model = BinaryData.fromString( - "{\"value\":[{\"location\":\"razftxejwabmdujt\",\"properties\":{\"provisioningState\":\"Disconnected\",\"installedDate\":\"2021-11-13T23:19:59Z\",\"description\":\"c\",\"minSbeVersionRequired\":\"urbuhhlkyqltq\",\"state\":\"AdditionalContentRequired\",\"prerequisites\":[{\"updateType\":\"wkffdjkt\",\"version\":\"sidfv\",\"packageName\":\"g\"},{\"updateType\":\"n\",\"version\":\"ijtk\",\"packageName\":\"sqo\"}],\"componentVersions\":[{\"packageType\":\"kayi\",\"version\":\"sharujtj\",\"lastUpdated\":\"2021-07-10T17:52:36Z\"},{\"packageType\":\"zyjq\",\"version\":\"vwkpqh\",\"lastUpdated\":\"2021-07-09T12:00:41Z\"},{\"packageType\":\"uygb\",\"version\":\"qqekewvnqvcdlgu\",\"lastUpdated\":\"2021-11-05T12:42:34Z\"},{\"packageType\":\"f\",\"version\":\"wnlaxpu\",\"lastUpdated\":\"2021-08-11T07:22:41Z\"}],\"rebootRequired\":\"Unknown\",\"healthState\":\"Failure\",\"healthCheckResult\":[{\"name\":\"tacgxmfc\",\"displayName\":\"er\",\"tags\":{},\"healthCheckTags\":\"datavs\",\"title\":\"hlwntsjgq\",\"status\":\"Failed\",\"severity\":\"Critical\",\"description\":\"uuuybnchrsziz\",\"remediation\":\"uelyetndn\",\"targetResourceID\":\"qyggagfl\",\"targetResourceName\":\"gm\",\"targetResourceType\":\"wahzjmucftbyr\",\"timestamp\":\"2021-04-22T08:33:43Z\",\"additionalData\":\"hkpigqfusuckzmkw\",\"healthCheckSource\":\"snoxaxmqeqa\"},{\"name\":\"hjnhgwydyynfsvk\",\"displayName\":\"bvqt\",\"tags\":{},\"healthCheckTags\":\"datarfdl\",\"title\":\"kh\",\"status\":\"NotYetRegistered\",\"severity\":\"Hidden\",\"description\":\"zjcpeogk\",\"remediation\":\"mgbro\",\"targetResourceID\":\"ddbhf\",\"targetResourceName\":\"fpazjzoywjxhpd\",\"targetResourceType\":\"ontacnpq\",\"timestamp\":\"2020-12-27T20:17:23Z\",\"additionalData\":\"tuevrh\",\"healthCheckSource\":\"jyoogwxh\"}],\"healthCheckDate\":\"2021-05-24T18:00:52Z\",\"packagePath\":\"ugwbsreurfqkf\",\"packageSizeInMb\":98.716385,\"displayName\":\"nlvhhtklnvnafvv\",\"version\":\"f\",\"publisher\":\"ev\",\"releaseLink\":\"oslc\",\"availabilityType\":\"Online\",\"packageType\":\"okkhminq\",\"additionalProperties\":\"mczngn\",\"updateStateProperties\":{\"progressPercentage\":4.8717856,\"notifyMessage\":\"wuninv\"}},\"id\":\"bchaqd\",\"name\":\"vqecr\",\"type\":\"ct\"},{\"location\":\"xdtddmflhuytxzv\",\"properties\":{\"provisioningState\":\"DisableInProgress\",\"installedDate\":\"2021-03-01T11:01:37Z\",\"description\":\"annovvoxczytpr\",\"minSbeVersionRequired\":\"wvroevytlyokrrr\",\"state\":\"PreparationFailed\",\"prerequisites\":[{\"updateType\":\"sasbcrymodizrx\",\"version\":\"obdxnazpmkmlm\",\"packageName\":\"vfxzopjh\"},{\"updateType\":\"xliohrdddt\",\"version\":\"xqbawpc\",\"packageName\":\"nzqcy\"},{\"updateType\":\"apqofyuicdhz\",\"version\":\"ybww\",\"packageName\":\"d\"},{\"updateType\":\"bid\",\"version\":\"m\",\"packageName\":\"f\"}],\"componentVersions\":[{\"packageType\":\"u\",\"version\":\"pckc\",\"lastUpdated\":\"2021-12-09T01:38:35Z\"},{\"packageType\":\"weyoxoy\",\"version\":\"k\",\"lastUpdated\":\"2021-09-08T11:55:35Z\"},{\"packageType\":\"mmoiroqboshbra\",\"version\":\"pyyrmfs\",\"lastUpdated\":\"2021-03-28T08:56:43Z\"}],\"rebootRequired\":\"Unknown\",\"healthState\":\"InProgress\",\"healthCheckResult\":[{\"name\":\"pdbwnupgahxkum\",\"displayName\":\"jcaacfdmmcpugm\",\"tags\":{},\"healthCheckTags\":\"dataepvufhbzehew\",\"title\":\"qhnlbqnbld\",\"status\":\"NotSpecified\",\"severity\":\"Critical\",\"description\":\"schori\",\"remediation\":\"rsrrmoucsofldp\",\"targetResourceID\":\"iyfc\",\"targetResourceName\":\"beolh\",\"targetResourceType\":\"lvbmxuqibsxtkcu\",\"timestamp\":\"2021-03-04T11:35:39Z\",\"additionalData\":\"farfs\",\"healthCheckSource\":\"wlkjxn\"},{\"name\":\"vwgf\",\"displayName\":\"mhqykizmdksa\",\"tags\":{},\"healthCheckTags\":\"datacluqvo\",\"title\":\"ycjimryvwgcwwpbm\",\"status\":\"ValidationFailed\",\"severity\":\"Informational\",\"description\":\"dsxwefoh\",\"remediation\":\"bvopwndyqle\",\"targetResourceID\":\"lklmtkhlo\",\"targetResourceName\":\"x\",\"targetResourceType\":\"vbrdfjmzsyzfho\",\"timestamp\":\"2021-03-23T11:42:29Z\",\"additionalData\":\"k\",\"healthCheckSource\":\"ychunsjlpjrtwszh\"}],\"healthCheckDate\":\"2021-11-19T08:14:33Z\",\"packagePath\":\"c\",\"packageSizeInMb\":95.381325,\"displayName\":\"rrmhwrbfdp\",\"version\":\"lubhvjg\",\"publisher\":\"ocu\",\"releaseLink\":\"lw\",\"availabilityType\":\"Notify\",\"packageType\":\"mhoocl\",\"additionalProperties\":\"n\",\"updateStateProperties\":{\"progressPercentage\":16.419632,\"notifyMessage\":\"czj\"}},\"id\":\"mykyujxsglhs\",\"name\":\"rryejylmbkzudnig\",\"type\":\"fihotj\"}],\"nextLink\":\"lpxuzzjgnrefq\"}") - .toObject(UpdateList.class); - Assertions.assertEquals("razftxejwabmdujt", model.value().get(0).location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T23:19:59Z"), model.value().get(0).installedDate()); - Assertions.assertEquals("c", model.value().get(0).description()); - Assertions.assertEquals("urbuhhlkyqltq", model.value().get(0).minSbeVersionRequired()); - Assertions.assertEquals(State.ADDITIONAL_CONTENT_REQUIRED, model.value().get(0).state()); - Assertions.assertEquals("wkffdjkt", model.value().get(0).prerequisites().get(0).updateType()); - Assertions.assertEquals("sidfv", model.value().get(0).prerequisites().get(0).version()); - Assertions.assertEquals("g", model.value().get(0).prerequisites().get(0).packageName()); - Assertions.assertEquals("kayi", model.value().get(0).componentVersions().get(0).packageType()); - Assertions.assertEquals("sharujtj", model.value().get(0).componentVersions().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T17:52:36Z"), - model.value().get(0).componentVersions().get(0).lastUpdated()); - Assertions.assertEquals(RebootRequirement.UNKNOWN, model.value().get(0).rebootRequired()); - Assertions.assertEquals(HealthState.FAILURE, model.value().get(0).healthState()); - Assertions.assertEquals("tacgxmfc", model.value().get(0).healthCheckResult().get(0).name()); - Assertions.assertEquals("er", model.value().get(0).healthCheckResult().get(0).displayName()); - Assertions.assertEquals("hlwntsjgq", model.value().get(0).healthCheckResult().get(0).title()); - Assertions.assertEquals(Status.FAILED, model.value().get(0).healthCheckResult().get(0).status()); - Assertions.assertEquals(Severity.CRITICAL, model.value().get(0).healthCheckResult().get(0).severity()); - Assertions.assertEquals("uuuybnchrsziz", model.value().get(0).healthCheckResult().get(0).description()); - Assertions.assertEquals("uelyetndn", model.value().get(0).healthCheckResult().get(0).remediation()); - Assertions.assertEquals("qyggagfl", model.value().get(0).healthCheckResult().get(0).targetResourceId()); - Assertions.assertEquals("gm", model.value().get(0).healthCheckResult().get(0).targetResourceName()); - Assertions.assertEquals("wahzjmucftbyr", model.value().get(0).healthCheckResult().get(0).targetResourceType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T08:33:43Z"), - model.value().get(0).healthCheckResult().get(0).timestamp()); - Assertions.assertEquals("hkpigqfusuckzmkw", model.value().get(0).healthCheckResult().get(0).additionalData()); - Assertions.assertEquals("snoxaxmqeqa", model.value().get(0).healthCheckResult().get(0).healthCheckSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T18:00:52Z"), model.value().get(0).healthCheckDate()); - Assertions.assertEquals("ugwbsreurfqkf", model.value().get(0).packagePath()); - Assertions.assertEquals(98.716385F, model.value().get(0).packageSizeInMb()); - Assertions.assertEquals("nlvhhtklnvnafvv", model.value().get(0).displayName()); - Assertions.assertEquals("f", model.value().get(0).version()); - Assertions.assertEquals("ev", model.value().get(0).publisher()); - Assertions.assertEquals("oslc", model.value().get(0).releaseLink()); - Assertions.assertEquals(AvailabilityType.ONLINE, model.value().get(0).availabilityType()); - Assertions.assertEquals("okkhminq", model.value().get(0).packageType()); - Assertions.assertEquals("mczngn", model.value().get(0).additionalProperties()); - Assertions.assertEquals(4.8717856F, model.value().get(0).progressPercentage()); - Assertions.assertEquals("wuninv", model.value().get(0).notifyMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateList model = new UpdateList().withValue(Arrays.asList( - new HciUpdateInner().withLocation("razftxejwabmdujt") - .withInstalledDate(OffsetDateTime.parse("2021-11-13T23:19:59Z")) - .withDescription("c") - .withMinSbeVersionRequired("urbuhhlkyqltq") - .withState(State.ADDITIONAL_CONTENT_REQUIRED) - .withPrerequisites(Arrays.asList( - new UpdatePrerequisite().withUpdateType("wkffdjkt").withVersion("sidfv").withPackageName("g"), - new UpdatePrerequisite().withUpdateType("n").withVersion("ijtk").withPackageName("sqo"))) - .withComponentVersions(Arrays.asList( - new PackageVersionInfo().withPackageType("kayi") - .withVersion("sharujtj") - .withLastUpdated(OffsetDateTime.parse("2021-07-10T17:52:36Z")), - new PackageVersionInfo().withPackageType("zyjq") - .withVersion("vwkpqh") - .withLastUpdated(OffsetDateTime.parse("2021-07-09T12:00:41Z")), - new PackageVersionInfo().withPackageType("uygb") - .withVersion("qqekewvnqvcdlgu") - .withLastUpdated(OffsetDateTime.parse("2021-11-05T12:42:34Z")), - new PackageVersionInfo().withPackageType("f") - .withVersion("wnlaxpu") - .withLastUpdated(OffsetDateTime.parse("2021-08-11T07:22:41Z")))) - .withRebootRequired(RebootRequirement.UNKNOWN) - .withHealthState(HealthState.FAILURE) - .withHealthCheckResult(Arrays.asList( - new PrecheckResult().withName("tacgxmfc") - .withDisplayName("er") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datavs") - .withTitle("hlwntsjgq") - .withStatus(Status.FAILED) - .withSeverity(Severity.CRITICAL) - .withDescription("uuuybnchrsziz") - .withRemediation("uelyetndn") - .withTargetResourceId("qyggagfl") - .withTargetResourceName("gm") - .withTargetResourceType("wahzjmucftbyr") - .withTimestamp(OffsetDateTime.parse("2021-04-22T08:33:43Z")) - .withAdditionalData("hkpigqfusuckzmkw") - .withHealthCheckSource("snoxaxmqeqa"), - new PrecheckResult().withName("hjnhgwydyynfsvk") - .withDisplayName("bvqt") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datarfdl") - .withTitle("kh") - .withStatus(Status.NOT_YET_REGISTERED) - .withSeverity(Severity.HIDDEN) - .withDescription("zjcpeogk") - .withRemediation("mgbro") - .withTargetResourceId("ddbhf") - .withTargetResourceName("fpazjzoywjxhpd") - .withTargetResourceType("ontacnpq") - .withTimestamp(OffsetDateTime.parse("2020-12-27T20:17:23Z")) - .withAdditionalData("tuevrh") - .withHealthCheckSource("jyoogwxh"))) - .withHealthCheckDate(OffsetDateTime.parse("2021-05-24T18:00:52Z")) - .withPackagePath("ugwbsreurfqkf") - .withPackageSizeInMb(98.716385F) - .withDisplayName("nlvhhtklnvnafvv") - .withVersion("f") - .withPublisher("ev") - .withReleaseLink("oslc") - .withAvailabilityType(AvailabilityType.ONLINE) - .withPackageType("okkhminq") - .withAdditionalProperties("mczngn") - .withProgressPercentage(4.8717856F) - .withNotifyMessage("wuninv"), - new HciUpdateInner().withLocation("xdtddmflhuytxzv") - .withInstalledDate(OffsetDateTime.parse("2021-03-01T11:01:37Z")) - .withDescription("annovvoxczytpr") - .withMinSbeVersionRequired("wvroevytlyokrrr") - .withState(State.PREPARATION_FAILED) - .withPrerequisites(Arrays.asList( - new UpdatePrerequisite().withUpdateType("sasbcrymodizrx") - .withVersion("obdxnazpmkmlm") - .withPackageName("vfxzopjh"), - new UpdatePrerequisite().withUpdateType("xliohrdddt") - .withVersion("xqbawpc") - .withPackageName("nzqcy"), - new UpdatePrerequisite().withUpdateType("apqofyuicdhz").withVersion("ybww").withPackageName("d"), - new UpdatePrerequisite().withUpdateType("bid").withVersion("m").withPackageName("f"))) - .withComponentVersions(Arrays.asList( - new PackageVersionInfo().withPackageType("u") - .withVersion("pckc") - .withLastUpdated(OffsetDateTime.parse("2021-12-09T01:38:35Z")), - new PackageVersionInfo().withPackageType("weyoxoy") - .withVersion("k") - .withLastUpdated(OffsetDateTime.parse("2021-09-08T11:55:35Z")), - new PackageVersionInfo().withPackageType("mmoiroqboshbra") - .withVersion("pyyrmfs") - .withLastUpdated(OffsetDateTime.parse("2021-03-28T08:56:43Z")))) - .withRebootRequired(RebootRequirement.UNKNOWN) - .withHealthState(HealthState.IN_PROGRESS) - .withHealthCheckResult(Arrays.asList( - new PrecheckResult().withName("pdbwnupgahxkum") - .withDisplayName("jcaacfdmmcpugm") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("dataepvufhbzehew") - .withTitle("qhnlbqnbld") - .withStatus(Status.NOT_SPECIFIED) - .withSeverity(Severity.CRITICAL) - .withDescription("schori") - .withRemediation("rsrrmoucsofldp") - .withTargetResourceId("iyfc") - .withTargetResourceName("beolh") - .withTargetResourceType("lvbmxuqibsxtkcu") - .withTimestamp(OffsetDateTime.parse("2021-03-04T11:35:39Z")) - .withAdditionalData("farfs") - .withHealthCheckSource("wlkjxn"), - new PrecheckResult().withName("vwgf") - .withDisplayName("mhqykizmdksa") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datacluqvo") - .withTitle("ycjimryvwgcwwpbm") - .withStatus(Status.VALIDATION_FAILED) - .withSeverity(Severity.INFORMATIONAL) - .withDescription("dsxwefoh") - .withRemediation("bvopwndyqle") - .withTargetResourceId("lklmtkhlo") - .withTargetResourceName("x") - .withTargetResourceType("vbrdfjmzsyzfho") - .withTimestamp(OffsetDateTime.parse("2021-03-23T11:42:29Z")) - .withAdditionalData("k") - .withHealthCheckSource("ychunsjlpjrtwszh"))) - .withHealthCheckDate(OffsetDateTime.parse("2021-11-19T08:14:33Z")) - .withPackagePath("c") - .withPackageSizeInMb(95.381325F) - .withDisplayName("rrmhwrbfdp") - .withVersion("lubhvjg") - .withPublisher("ocu") - .withReleaseLink("lw") - .withAvailabilityType(AvailabilityType.NOTIFY) - .withPackageType("mhoocl") - .withAdditionalProperties("n") - .withProgressPercentage(16.419632F) - .withNotifyMessage("czj"))); - model = BinaryData.fromObject(model).toObject(UpdateList.class); - Assertions.assertEquals("razftxejwabmdujt", model.value().get(0).location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T23:19:59Z"), model.value().get(0).installedDate()); - Assertions.assertEquals("c", model.value().get(0).description()); - Assertions.assertEquals("urbuhhlkyqltq", model.value().get(0).minSbeVersionRequired()); - Assertions.assertEquals(State.ADDITIONAL_CONTENT_REQUIRED, model.value().get(0).state()); - Assertions.assertEquals("wkffdjkt", model.value().get(0).prerequisites().get(0).updateType()); - Assertions.assertEquals("sidfv", model.value().get(0).prerequisites().get(0).version()); - Assertions.assertEquals("g", model.value().get(0).prerequisites().get(0).packageName()); - Assertions.assertEquals("kayi", model.value().get(0).componentVersions().get(0).packageType()); - Assertions.assertEquals("sharujtj", model.value().get(0).componentVersions().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T17:52:36Z"), - model.value().get(0).componentVersions().get(0).lastUpdated()); - Assertions.assertEquals(RebootRequirement.UNKNOWN, model.value().get(0).rebootRequired()); - Assertions.assertEquals(HealthState.FAILURE, model.value().get(0).healthState()); - Assertions.assertEquals("tacgxmfc", model.value().get(0).healthCheckResult().get(0).name()); - Assertions.assertEquals("er", model.value().get(0).healthCheckResult().get(0).displayName()); - Assertions.assertEquals("hlwntsjgq", model.value().get(0).healthCheckResult().get(0).title()); - Assertions.assertEquals(Status.FAILED, model.value().get(0).healthCheckResult().get(0).status()); - Assertions.assertEquals(Severity.CRITICAL, model.value().get(0).healthCheckResult().get(0).severity()); - Assertions.assertEquals("uuuybnchrsziz", model.value().get(0).healthCheckResult().get(0).description()); - Assertions.assertEquals("uelyetndn", model.value().get(0).healthCheckResult().get(0).remediation()); - Assertions.assertEquals("qyggagfl", model.value().get(0).healthCheckResult().get(0).targetResourceId()); - Assertions.assertEquals("gm", model.value().get(0).healthCheckResult().get(0).targetResourceName()); - Assertions.assertEquals("wahzjmucftbyr", model.value().get(0).healthCheckResult().get(0).targetResourceType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T08:33:43Z"), - model.value().get(0).healthCheckResult().get(0).timestamp()); - Assertions.assertEquals("hkpigqfusuckzmkw", model.value().get(0).healthCheckResult().get(0).additionalData()); - Assertions.assertEquals("snoxaxmqeqa", model.value().get(0).healthCheckResult().get(0).healthCheckSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T18:00:52Z"), model.value().get(0).healthCheckDate()); - Assertions.assertEquals("ugwbsreurfqkf", model.value().get(0).packagePath()); - Assertions.assertEquals(98.716385F, model.value().get(0).packageSizeInMb()); - Assertions.assertEquals("nlvhhtklnvnafvv", model.value().get(0).displayName()); - Assertions.assertEquals("f", model.value().get(0).version()); - Assertions.assertEquals("ev", model.value().get(0).publisher()); - Assertions.assertEquals("oslc", model.value().get(0).releaseLink()); - Assertions.assertEquals(AvailabilityType.ONLINE, model.value().get(0).availabilityType()); - Assertions.assertEquals("okkhminq", model.value().get(0).packageType()); - Assertions.assertEquals("mczngn", model.value().get(0).additionalProperties()); - Assertions.assertEquals(4.8717856F, model.value().get(0).progressPercentage()); - Assertions.assertEquals("wuninv", model.value().get(0).notifyMessage()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatePrerequisiteTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatePrerequisiteTests.java deleted file mode 100644 index 94b783dcd664..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatePrerequisiteTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; -import org.junit.jupiter.api.Assertions; - -public final class UpdatePrerequisiteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdatePrerequisite model - = BinaryData.fromString("{\"updateType\":\"wvnph\",\"version\":\"zqtpjhmq\",\"packageName\":\"v\"}") - .toObject(UpdatePrerequisite.class); - Assertions.assertEquals("wvnph", model.updateType()); - Assertions.assertEquals("zqtpjhmq", model.version()); - Assertions.assertEquals("v", model.packageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdatePrerequisite model - = new UpdatePrerequisite().withUpdateType("wvnph").withVersion("zqtpjhmq").withPackageName("v"); - model = BinaryData.fromObject(model).toObject(UpdatePrerequisite.class); - Assertions.assertEquals("wvnph", model.updateType()); - Assertions.assertEquals("zqtpjhmq", model.version()); - Assertions.assertEquals("v", model.packageName()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunInnerTests.java deleted file mode 100644 index 618289632f8d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunInnerTests.java +++ /dev/null @@ -1,121 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunInner model = BinaryData.fromString( - "{\"location\":\"qmeqwigpibudqwyx\",\"properties\":{\"provisioningState\":\"InProgress\",\"timeStarted\":\"2021-06-11T15:08:27Z\",\"lastUpdatedTime\":\"2021-03-14T02:43:50Z\",\"duration\":\"nrtffyaqi\",\"state\":\"Failed\",\"progress\":{\"name\":\"ioqaqhvs\",\"description\":\"fuqyrxpdlcgqlsi\",\"errorMessage\":\"jqfrddgamquh\",\"status\":\"srsjuivfc\",\"startTimeUtc\":\"2021-02-02T15:06:24Z\",\"endTimeUtc\":\"2021-08-07T02:17:36Z\",\"lastUpdatedTimeUtc\":\"2021-01-27T18:11:59Z\",\"expectedExecutionTime\":\"zhczexrxzbujrtrh\",\"steps\":[{\"name\":\"evkh\",\"description\":\"lnzonzlrpiqywn\",\"errorMessage\":\"jtszcof\",\"status\":\"e\",\"startTimeUtc\":\"2021-11-08T03:11:49Z\",\"endTimeUtc\":\"2021-07-02T17:33:01Z\",\"lastUpdatedTimeUtc\":\"2021-11-22T18:06:29Z\",\"expectedExecutionTime\":\"vreljea\",\"steps\":[{},{},{}]},{\"name\":\"zmlovuanash\",\"description\":\"lpmjerb\",\"errorMessage\":\"elvidizozsdbccx\",\"status\":\"on\",\"startTimeUtc\":\"2021-06-26T18:58:09Z\",\"endTimeUtc\":\"2021-08-14T04:15:27Z\",\"lastUpdatedTimeUtc\":\"2021-05-09T18:26:05Z\",\"expectedExecutionTime\":\"puuw\",\"steps\":[{},{},{},{}]},{\"name\":\"uqj\",\"description\":\"zenkeifzzhmkd\",\"errorMessage\":\"vflyhbxcu\",\"status\":\"hxgsrboldfor\",\"startTimeUtc\":\"2020-12-20T04:35:15Z\",\"endTimeUtc\":\"2021-06-11T04:52:49Z\",\"lastUpdatedTimeUtc\":\"2021-02-10T16:46:43Z\",\"expectedExecutionTime\":\"bfhfovvacqp\",\"steps\":[{},{}]},{\"name\":\"dxe\",\"description\":\"abbelawumuaslzk\",\"errorMessage\":\"rwoycqucwyh\",\"status\":\"nomdrkywuhpsv\",\"startTimeUtc\":\"2021-05-26T05:35:58Z\",\"endTimeUtc\":\"2021-01-31T05:51:43Z\",\"lastUpdatedTimeUtc\":\"2021-08-15T09:05:35Z\",\"expectedExecutionTime\":\"exxwlalniexzsrz\",\"steps\":[{},{}]}]}},\"id\":\"q\",\"name\":\"yb\",\"type\":\"wwpgdakchzyvlixq\"}") - .toObject(UpdateRunInner.class); - Assertions.assertEquals("qmeqwigpibudqwyx", model.location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T15:08:27Z"), model.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T02:43:50Z"), model.lastUpdatedTime()); - Assertions.assertEquals("nrtffyaqi", model.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.FAILED, model.state()); - Assertions.assertEquals("ioqaqhvs", model.namePropertiesName()); - Assertions.assertEquals("fuqyrxpdlcgqlsi", model.description()); - Assertions.assertEquals("jqfrddgamquh", model.errorMessage()); - Assertions.assertEquals("srsjuivfc", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T15:06:24Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T02:17:36Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T18:11:59Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("zhczexrxzbujrtrh", model.expectedExecutionTime()); - Assertions.assertEquals("evkh", model.steps().get(0).name()); - Assertions.assertEquals("lnzonzlrpiqywn", model.steps().get(0).description()); - Assertions.assertEquals("jtszcof", model.steps().get(0).errorMessage()); - Assertions.assertEquals("e", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-08T03:11:49Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T17:33:01Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T18:06:29Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("vreljea", model.steps().get(0).expectedExecutionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunInner model = new UpdateRunInner().withLocation("qmeqwigpibudqwyx") - .withTimeStarted(OffsetDateTime.parse("2021-06-11T15:08:27Z")) - .withLastUpdatedTime(OffsetDateTime.parse("2021-03-14T02:43:50Z")) - .withDuration("nrtffyaqi") - .withState(UpdateRunPropertiesState.FAILED) - .withNamePropertiesName("ioqaqhvs") - .withDescription("fuqyrxpdlcgqlsi") - .withErrorMessage("jqfrddgamquh") - .withStatus("srsjuivfc") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-02T15:06:24Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-08-07T02:17:36Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-01-27T18:11:59Z")) - .withExpectedExecutionTime("zhczexrxzbujrtrh") - .withSteps(Arrays.asList( - new Step().withName("evkh") - .withDescription("lnzonzlrpiqywn") - .withErrorMessage("jtszcof") - .withStatus("e") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-08T03:11:49Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-07-02T17:33:01Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-11-22T18:06:29Z")) - .withExpectedExecutionTime("vreljea") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())), - new Step().withName("zmlovuanash") - .withDescription("lpmjerb") - .withErrorMessage("elvidizozsdbccx") - .withStatus("on") - .withStartTimeUtc(OffsetDateTime.parse("2021-06-26T18:58:09Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-08-14T04:15:27Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-05-09T18:26:05Z")) - .withExpectedExecutionTime("puuw") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())), - new Step().withName("uqj") - .withDescription("zenkeifzzhmkd") - .withErrorMessage("vflyhbxcu") - .withStatus("hxgsrboldfor") - .withStartTimeUtc(OffsetDateTime.parse("2020-12-20T04:35:15Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-06-11T04:52:49Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-02-10T16:46:43Z")) - .withExpectedExecutionTime("bfhfovvacqp") - .withSteps(Arrays.asList(new Step(), new Step())), - new Step().withName("dxe") - .withDescription("abbelawumuaslzk") - .withErrorMessage("rwoycqucwyh") - .withStatus("nomdrkywuhpsv") - .withStartTimeUtc(OffsetDateTime.parse("2021-05-26T05:35:58Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-01-31T05:51:43Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-08-15T09:05:35Z")) - .withExpectedExecutionTime("exxwlalniexzsrz") - .withSteps(Arrays.asList(new Step(), new Step())))); - model = BinaryData.fromObject(model).toObject(UpdateRunInner.class); - Assertions.assertEquals("qmeqwigpibudqwyx", model.location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T15:08:27Z"), model.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T02:43:50Z"), model.lastUpdatedTime()); - Assertions.assertEquals("nrtffyaqi", model.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.FAILED, model.state()); - Assertions.assertEquals("ioqaqhvs", model.namePropertiesName()); - Assertions.assertEquals("fuqyrxpdlcgqlsi", model.description()); - Assertions.assertEquals("jqfrddgamquh", model.errorMessage()); - Assertions.assertEquals("srsjuivfc", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T15:06:24Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T02:17:36Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T18:11:59Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("zhczexrxzbujrtrh", model.expectedExecutionTime()); - Assertions.assertEquals("evkh", model.steps().get(0).name()); - Assertions.assertEquals("lnzonzlrpiqywn", model.steps().get(0).description()); - Assertions.assertEquals("jtszcof", model.steps().get(0).errorMessage()); - Assertions.assertEquals("e", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-08T03:11:49Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T17:33:01Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T18:06:29Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("vreljea", model.steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunListTests.java deleted file mode 100644 index c50c9b2854e1..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunListTests.java +++ /dev/null @@ -1,70 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunList; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunList model = BinaryData.fromString( - "{\"value\":[{\"location\":\"joylh\",\"properties\":{\"provisioningState\":\"PartiallySucceeded\",\"timeStarted\":\"2021-01-16T20:29:46Z\",\"lastUpdatedTime\":\"2021-08-30T04:34:11Z\",\"duration\":\"imrsopteecjmei\",\"state\":\"Failed\",\"progress\":{\"name\":\"asylwx\",\"description\":\"aumweoohguufu\",\"errorMessage\":\"oyjathwtzol\",\"status\":\"emwmdxmebwjs\",\"startTimeUtc\":\"2021-09-18T07:25:35Z\",\"endTimeUtc\":\"2021-04-09T17:42:24Z\",\"lastUpdatedTimeUtc\":\"2021-10-23T16:03:49Z\",\"expectedExecutionTime\":\"eabfqxnm\",\"steps\":[{},{},{}]}},\"id\":\"ibxyijddtvqc\",\"name\":\"tad\",\"type\":\"jaeukmrsieekpn\"}],\"nextLink\":\"aapm\"}") - .toObject(UpdateRunList.class); - Assertions.assertEquals("joylh", model.value().get(0).location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T20:29:46Z"), model.value().get(0).timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T04:34:11Z"), model.value().get(0).lastUpdatedTime()); - Assertions.assertEquals("imrsopteecjmei", model.value().get(0).duration()); - Assertions.assertEquals(UpdateRunPropertiesState.FAILED, model.value().get(0).state()); - Assertions.assertEquals("asylwx", model.value().get(0).namePropertiesName()); - Assertions.assertEquals("aumweoohguufu", model.value().get(0).description()); - Assertions.assertEquals("oyjathwtzol", model.value().get(0).errorMessage()); - Assertions.assertEquals("emwmdxmebwjs", model.value().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T07:25:35Z"), model.value().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T17:42:24Z"), model.value().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T16:03:49Z"), - model.value().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("eabfqxnm", model.value().get(0).expectedExecutionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunList model = new UpdateRunList().withValue(Arrays.asList(new UpdateRunInner().withLocation("joylh") - .withTimeStarted(OffsetDateTime.parse("2021-01-16T20:29:46Z")) - .withLastUpdatedTime(OffsetDateTime.parse("2021-08-30T04:34:11Z")) - .withDuration("imrsopteecjmei") - .withState(UpdateRunPropertiesState.FAILED) - .withNamePropertiesName("asylwx") - .withDescription("aumweoohguufu") - .withErrorMessage("oyjathwtzol") - .withStatus("emwmdxmebwjs") - .withStartTimeUtc(OffsetDateTime.parse("2021-09-18T07:25:35Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-09T17:42:24Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-10-23T16:03:49Z")) - .withExpectedExecutionTime("eabfqxnm") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())))); - model = BinaryData.fromObject(model).toObject(UpdateRunList.class); - Assertions.assertEquals("joylh", model.value().get(0).location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T20:29:46Z"), model.value().get(0).timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T04:34:11Z"), model.value().get(0).lastUpdatedTime()); - Assertions.assertEquals("imrsopteecjmei", model.value().get(0).duration()); - Assertions.assertEquals(UpdateRunPropertiesState.FAILED, model.value().get(0).state()); - Assertions.assertEquals("asylwx", model.value().get(0).namePropertiesName()); - Assertions.assertEquals("aumweoohguufu", model.value().get(0).description()); - Assertions.assertEquals("oyjathwtzol", model.value().get(0).errorMessage()); - Assertions.assertEquals("emwmdxmebwjs", model.value().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T07:25:35Z"), model.value().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T17:42:24Z"), model.value().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T16:03:49Z"), - model.value().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("eabfqxnm", model.value().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunPropertiesTests.java deleted file mode 100644 index 05abfd385863..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunPropertiesTests.java +++ /dev/null @@ -1,180 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunProperties; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Updating\",\"timeStarted\":\"2021-03-05T11:05:18Z\",\"lastUpdatedTime\":\"2021-02-01T08:02:04Z\",\"duration\":\"bn\",\"state\":\"Unknown\",\"progress\":{\"name\":\"xs\",\"description\":\"rntvlwijp\",\"errorMessage\":\"texoqqpwc\",\"status\":\"ufmhrunc\",\"startTimeUtc\":\"2021-09-21T16:25:56Z\",\"endTimeUtc\":\"2021-09-21T10:04:50Z\",\"lastUpdatedTimeUtc\":\"2021-08-20T13:44:39Z\",\"expectedExecutionTime\":\"dqzh\",\"steps\":[{\"name\":\"dunqnd\",\"description\":\"pchrqbn\",\"errorMessage\":\"rcgegydcwboxjum\",\"status\":\"qoli\",\"startTimeUtc\":\"2021-06-22T06:33:09Z\",\"endTimeUtc\":\"2021-05-10T13:24:14Z\",\"lastUpdatedTimeUtc\":\"2021-05-20T12:59:42Z\",\"expectedExecutionTime\":\"ubrjtl\",\"steps\":[{\"name\":\"uojrngiflr\",\"description\":\"asccbiui\",\"errorMessage\":\"dlyjdf\",\"status\":\"mkyoqufdvruzsl\",\"startTimeUtc\":\"2021-03-20T10:33:48Z\",\"endTimeUtc\":\"2021-04-15T06:18:59Z\",\"lastUpdatedTimeUtc\":\"2021-07-08T06:56:22Z\",\"expectedExecutionTime\":\"nmdxotngfd\",\"steps\":[{},{},{},{}]},{\"name\":\"yzihgrkyuizabsn\",\"description\":\"pphoj\",\"errorMessage\":\"vyhyhsgzfc\",\"status\":\"gomfgbeglq\",\"startTimeUtc\":\"2021-11-28T19:12:57Z\",\"endTimeUtc\":\"2021-06-10T19:13:40Z\",\"lastUpdatedTimeUtc\":\"2021-11-28T14:13:42Z\",\"expectedExecutionTime\":\"tnluankrr\",\"steps\":[{},{},{}]}]},{\"name\":\"ebtijvacvbmqzbqq\",\"description\":\"aj\",\"errorMessage\":\"wxacevehj\",\"status\":\"yxoaf\",\"startTimeUtc\":\"2021-03-08T11:58:40Z\",\"endTimeUtc\":\"2021-05-13T08:39:20Z\",\"lastUpdatedTimeUtc\":\"2021-06-28T21:13:43Z\",\"expectedExecutionTime\":\"eyl\",\"steps\":[{\"name\":\"gv\",\"description\":\"r\",\"errorMessage\":\"hriypoqeyhlqhy\",\"status\":\"rlpyznuciqdsmexi\",\"startTimeUtc\":\"2021-11-16T11:22:07Z\",\"endTimeUtc\":\"2021-08-01T15:36:59Z\",\"lastUpdatedTimeUtc\":\"2021-02-09T12:29:35Z\",\"expectedExecutionTime\":\"asiibmiybnnust\",\"steps\":[{},{},{},{}]},{\"name\":\"hnmgixhcm\",\"description\":\"mqfoudorh\",\"errorMessage\":\"yyprotwyp\",\"status\":\"d\",\"startTimeUtc\":\"2021-09-21T05:34:17Z\",\"endTimeUtc\":\"2021-09-26T18:20:07Z\",\"lastUpdatedTimeUtc\":\"2021-05-18T07:53:38Z\",\"expectedExecutionTime\":\"jkavl\",\"steps\":[{}]},{\"name\":\"mftpmdtz\",\"description\":\"ltfvnz\",\"errorMessage\":\"jtotpvopvpbd\",\"status\":\"qgqqihedsvqwthmk\",\"startTimeUtc\":\"2021-10-27T11:08:26Z\",\"endTimeUtc\":\"2021-10-29T01:22:50Z\",\"lastUpdatedTimeUtc\":\"2021-10-11T18:19:24Z\",\"expectedExecutionTime\":\"sgqcwdho\",\"steps\":[{},{}]},{\"name\":\"mcdzsufcohdxbz\",\"description\":\"cmuapcvhd\",\"errorMessage\":\"v\",\"status\":\"qxeysko\",\"startTimeUtc\":\"2020-12-31T09:10:56Z\",\"endTimeUtc\":\"2021-04-16T10:18:40Z\",\"lastUpdatedTimeUtc\":\"2021-02-01T01:33:34Z\",\"expectedExecutionTime\":\"bgbzbowxeqoclj\",\"steps\":[{},{},{},{}]}]}]}}") - .toObject(UpdateRunProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T11:05:18Z"), model.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T08:02:04Z"), model.lastUpdatedTime()); - Assertions.assertEquals("bn", model.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.UNKNOWN, model.state()); - Assertions.assertEquals("xs", model.name()); - Assertions.assertEquals("rntvlwijp", model.description()); - Assertions.assertEquals("texoqqpwc", model.errorMessage()); - Assertions.assertEquals("ufmhrunc", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T16:25:56Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T10:04:50Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T13:44:39Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("dqzh", model.expectedExecutionTime()); - Assertions.assertEquals("dunqnd", model.steps().get(0).name()); - Assertions.assertEquals("pchrqbn", model.steps().get(0).description()); - Assertions.assertEquals("rcgegydcwboxjum", model.steps().get(0).errorMessage()); - Assertions.assertEquals("qoli", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T06:33:09Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T13:24:14Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T12:59:42Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("ubrjtl", model.steps().get(0).expectedExecutionTime()); - Assertions.assertEquals("uojrngiflr", model.steps().get(0).steps().get(0).name()); - Assertions.assertEquals("asccbiui", model.steps().get(0).steps().get(0).description()); - Assertions.assertEquals("dlyjdf", model.steps().get(0).steps().get(0).errorMessage()); - Assertions.assertEquals("mkyoqufdvruzsl", model.steps().get(0).steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T10:33:48Z"), - model.steps().get(0).steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T06:18:59Z"), - model.steps().get(0).steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T06:56:22Z"), - model.steps().get(0).steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("nmdxotngfd", model.steps().get(0).steps().get(0).expectedExecutionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunProperties model - = new UpdateRunProperties().withTimeStarted(OffsetDateTime.parse("2021-03-05T11:05:18Z")) - .withLastUpdatedTime(OffsetDateTime.parse("2021-02-01T08:02:04Z")) - .withDuration("bn") - .withState(UpdateRunPropertiesState.UNKNOWN) - .withName("xs") - .withDescription("rntvlwijp") - .withErrorMessage("texoqqpwc") - .withStatus("ufmhrunc") - .withStartTimeUtc(OffsetDateTime.parse("2021-09-21T16:25:56Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-09-21T10:04:50Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-08-20T13:44:39Z")) - .withExpectedExecutionTime("dqzh") - .withSteps( - Arrays - .asList( - new Step().withName("dunqnd") - .withDescription("pchrqbn") - .withErrorMessage("rcgegydcwboxjum") - .withStatus("qoli") - .withStartTimeUtc(OffsetDateTime.parse("2021-06-22T06:33:09Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-05-10T13:24:14Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-05-20T12:59:42Z")) - .withExpectedExecutionTime("ubrjtl") - .withSteps( - Arrays.asList( - new Step().withName("uojrngiflr") - .withDescription("asccbiui") - .withErrorMessage("dlyjdf") - .withStatus("mkyoqufdvruzsl") - .withStartTimeUtc(OffsetDateTime.parse("2021-03-20T10:33:48Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-15T06:18:59Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-07-08T06:56:22Z")) - .withExpectedExecutionTime("nmdxotngfd") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())), - new Step().withName("yzihgrkyuizabsn") - .withDescription("pphoj") - .withErrorMessage("vyhyhsgzfc") - .withStatus("gomfgbeglq") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-28T19:12:57Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-06-10T19:13:40Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-11-28T14:13:42Z")) - .withExpectedExecutionTime("tnluankrr") - .withSteps(Arrays.asList(new Step(), new Step(), new Step())))), - new Step().withName("ebtijvacvbmqzbqq") - .withDescription("aj") - .withErrorMessage("wxacevehj") - .withStatus("yxoaf") - .withStartTimeUtc(OffsetDateTime.parse("2021-03-08T11:58:40Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-05-13T08:39:20Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-06-28T21:13:43Z")) - .withExpectedExecutionTime("eyl") - .withSteps(Arrays.asList( - new Step().withName("gv") - .withDescription("r") - .withErrorMessage("hriypoqeyhlqhy") - .withStatus("rlpyznuciqdsmexi") - .withStartTimeUtc(OffsetDateTime.parse("2021-11-16T11:22:07Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-08-01T15:36:59Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-02-09T12:29:35Z")) - .withExpectedExecutionTime("asiibmiybnnust") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())), - new Step().withName("hnmgixhcm") - .withDescription("mqfoudorh") - .withErrorMessage("yyprotwyp") - .withStatus("d") - .withStartTimeUtc(OffsetDateTime.parse("2021-09-21T05:34:17Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-09-26T18:20:07Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-05-18T07:53:38Z")) - .withExpectedExecutionTime("jkavl") - .withSteps(Arrays.asList(new Step())), - new Step().withName("mftpmdtz") - .withDescription("ltfvnz") - .withErrorMessage("jtotpvopvpbd") - .withStatus("qgqqihedsvqwthmk") - .withStartTimeUtc(OffsetDateTime.parse("2021-10-27T11:08:26Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-10-29T01:22:50Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-10-11T18:19:24Z")) - .withExpectedExecutionTime("sgqcwdho") - .withSteps(Arrays.asList(new Step(), new Step())), - new Step().withName("mcdzsufcohdxbz") - .withDescription("cmuapcvhd") - .withErrorMessage("v") - .withStatus("qxeysko") - .withStartTimeUtc(OffsetDateTime.parse("2020-12-31T09:10:56Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-16T10:18:40Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-02-01T01:33:34Z")) - .withExpectedExecutionTime("bgbzbowxeqoclj") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())))))); - model = BinaryData.fromObject(model).toObject(UpdateRunProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T11:05:18Z"), model.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T08:02:04Z"), model.lastUpdatedTime()); - Assertions.assertEquals("bn", model.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.UNKNOWN, model.state()); - Assertions.assertEquals("xs", model.name()); - Assertions.assertEquals("rntvlwijp", model.description()); - Assertions.assertEquals("texoqqpwc", model.errorMessage()); - Assertions.assertEquals("ufmhrunc", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T16:25:56Z"), model.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T10:04:50Z"), model.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T13:44:39Z"), model.lastUpdatedTimeUtc()); - Assertions.assertEquals("dqzh", model.expectedExecutionTime()); - Assertions.assertEquals("dunqnd", model.steps().get(0).name()); - Assertions.assertEquals("pchrqbn", model.steps().get(0).description()); - Assertions.assertEquals("rcgegydcwboxjum", model.steps().get(0).errorMessage()); - Assertions.assertEquals("qoli", model.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T06:33:09Z"), model.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T13:24:14Z"), model.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T12:59:42Z"), - model.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("ubrjtl", model.steps().get(0).expectedExecutionTime()); - Assertions.assertEquals("uojrngiflr", model.steps().get(0).steps().get(0).name()); - Assertions.assertEquals("asccbiui", model.steps().get(0).steps().get(0).description()); - Assertions.assertEquals("dlyjdf", model.steps().get(0).steps().get(0).errorMessage()); - Assertions.assertEquals("mkyoqufdvruzsl", model.steps().get(0).steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T10:33:48Z"), - model.steps().get(0).steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T06:18:59Z"), - model.steps().get(0).steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T06:56:22Z"), - model.steps().get(0).steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("nmdxotngfd", model.steps().get(0).steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteMockTests.java deleted file mode 100644 index 71abdd71d324..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdateRunsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.updateRuns().delete("ptqmawzjdrpiz", "ulgyctsdbtqgku", "dsooxr", "w", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetWithResponseMockTests.java deleted file mode 100644 index 45bff0ef8090..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetWithResponseMockTests.java +++ /dev/null @@ -1,62 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.UpdateRun; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdateRunsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"okpoyuoh\",\"properties\":{\"provisioningState\":\"Error\",\"timeStarted\":\"2021-11-30T03:35:25Z\",\"lastUpdatedTime\":\"2021-01-12T07:26:14Z\",\"duration\":\"hmpoe\",\"state\":\"Succeeded\",\"progress\":{\"name\":\"wsadaxjsumxpezc\",\"description\":\"oyj\",\"errorMessage\":\"fqzwqdnxkeed\",\"status\":\"wmywxfqzkvemy\",\"startTimeUtc\":\"2021-01-19T15:19:47Z\",\"endTimeUtc\":\"2021-08-16T22:35:08Z\",\"lastUpdatedTimeUtc\":\"2021-08-31T21:01Z\",\"expectedExecutionTime\":\"qifdbmptrwtxz\",\"steps\":[{\"name\":\"monatnizexroq\",\"description\":\"jghrmthsplwst\",\"errorMessage\":\"srgxfq\",\"status\":\"niceovxgzwh\",\"startTimeUtc\":\"2021-04-10T18:22:57Z\",\"endTimeUtc\":\"2021-10-08T22:52:41Z\",\"lastUpdatedTimeUtc\":\"2021-07-29T17:09:57Z\",\"expectedExecutionTime\":\"i\",\"steps\":[{}]},{\"name\":\"ik\",\"description\":\"hzixyqhfnkvy\",\"errorMessage\":\"qqdseipnquwzxhrp\",\"status\":\"odlhkfktl\",\"startTimeUtc\":\"2021-05-16T09:50:55Z\",\"endTimeUtc\":\"2021-01-31T17:06:28Z\",\"lastUpdatedTimeUtc\":\"2021-04-12T08:52:01Z\",\"expectedExecutionTime\":\"pnouhbqezkqx\",\"steps\":[{}]}]}},\"id\":\"zyigfcvc\",\"name\":\"wb\",\"type\":\"qhdgsjsatmrn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateRun response = manager.updateRuns() - .getWithResponse("eurbtigapdyarik", "ejdpdfhtwm", "kfqbriqulwwt", "jmeqkvy", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("okpoyuoh", response.location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-30T03:35:25Z"), response.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T07:26:14Z"), response.lastUpdatedTime()); - Assertions.assertEquals("hmpoe", response.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.SUCCEEDED, response.state()); - Assertions.assertEquals("wsadaxjsumxpezc", response.namePropertiesName()); - Assertions.assertEquals("oyj", response.description()); - Assertions.assertEquals("fqzwqdnxkeed", response.errorMessage()); - Assertions.assertEquals("wmywxfqzkvemy", response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T15:19:47Z"), response.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T22:35:08Z"), response.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T21:01Z"), response.lastUpdatedTimeUtc()); - Assertions.assertEquals("qifdbmptrwtxz", response.expectedExecutionTime()); - Assertions.assertEquals("monatnizexroq", response.steps().get(0).name()); - Assertions.assertEquals("jghrmthsplwst", response.steps().get(0).description()); - Assertions.assertEquals("srgxfq", response.steps().get(0).errorMessage()); - Assertions.assertEquals("niceovxgzwh", response.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T18:22:57Z"), response.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T22:52:41Z"), response.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T17:09:57Z"), - response.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("i", response.steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListMockTests.java deleted file mode 100644 index 448f36b19dae..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.UpdateRun; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdateRunsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"dlhvdv\",\"properties\":{\"provisioningState\":\"Deleted\",\"timeStarted\":\"2021-06-13T17:39:59Z\",\"lastUpdatedTime\":\"2021-07-22T20:38:54Z\",\"duration\":\"jzmhkdclacroczfm\",\"state\":\"InProgress\",\"progress\":{\"name\":\"eluxzshxzez\",\"description\":\"uzudlevzskejcg\",\"errorMessage\":\"sgqk\",\"status\":\"yecup\",\"startTimeUtc\":\"2021-09-29T13:22Z\",\"endTimeUtc\":\"2021-06-13T17:59:49Z\",\"lastUpdatedTimeUtc\":\"2021-08-11T03:52:04Z\",\"expectedExecutionTime\":\"avsjcfmazpzdq\",\"steps\":[{\"name\":\"cmcokxizekuv\",\"description\":\"jwucaonzva\",\"errorMessage\":\"vbnkrdemdidac\",\"status\":\"idgzwdydamis\",\"startTimeUtc\":\"2021-10-30T03:52:39Z\",\"endTimeUtc\":\"2021-03-26T14:45:23Z\",\"lastUpdatedTimeUtc\":\"2021-07-23T09:45:28Z\",\"expectedExecutionTime\":\"kpxkqejtpjfoj\",\"steps\":[{},{}]},{\"name\":\"lshxuknsykdto\",\"description\":\"oancdrco\",\"errorMessage\":\"vx\",\"status\":\"dxonckbn\",\"startTimeUtc\":\"2021-10-26T15:30:27Z\",\"endTimeUtc\":\"2021-04-15T17:53:27Z\",\"lastUpdatedTimeUtc\":\"2021-01-31T13:56:51Z\",\"expectedExecutionTime\":\"ibaqzi\",\"steps\":[{},{}]},{\"name\":\"zweghlwwbogvg\",\"description\":\"lqiy\",\"errorMessage\":\"veqelsbfvds\",\"status\":\"kzx\",\"startTimeUtc\":\"2021-08-12T08:15:32Z\",\"endTimeUtc\":\"2021-12-06T08:09:21Z\",\"lastUpdatedTimeUtc\":\"2021-09-24T03:50:20Z\",\"expectedExecutionTime\":\"rds\",\"steps\":[{},{},{}]}]}},\"id\":\"im\",\"name\":\"ndnoxaxnrqaq\",\"type\":\"tnndxolousdvr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.updateRuns().list("jemexmnv", "vmuw", "xlniwmcpm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dlhvdv", response.iterator().next().location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T17:39:59Z"), response.iterator().next().timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T20:38:54Z"), - response.iterator().next().lastUpdatedTime()); - Assertions.assertEquals("jzmhkdclacroczfm", response.iterator().next().duration()); - Assertions.assertEquals(UpdateRunPropertiesState.IN_PROGRESS, response.iterator().next().state()); - Assertions.assertEquals("eluxzshxzez", response.iterator().next().namePropertiesName()); - Assertions.assertEquals("uzudlevzskejcg", response.iterator().next().description()); - Assertions.assertEquals("sgqk", response.iterator().next().errorMessage()); - Assertions.assertEquals("yecup", response.iterator().next().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T13:22Z"), response.iterator().next().startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T17:59:49Z"), response.iterator().next().endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T03:52:04Z"), - response.iterator().next().lastUpdatedTimeUtc()); - Assertions.assertEquals("avsjcfmazpzdq", response.iterator().next().expectedExecutionTime()); - Assertions.assertEquals("cmcokxizekuv", response.iterator().next().steps().get(0).name()); - Assertions.assertEquals("jwucaonzva", response.iterator().next().steps().get(0).description()); - Assertions.assertEquals("vbnkrdemdidac", response.iterator().next().steps().get(0).errorMessage()); - Assertions.assertEquals("idgzwdydamis", response.iterator().next().steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T03:52:39Z"), - response.iterator().next().steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T14:45:23Z"), - response.iterator().next().steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T09:45:28Z"), - response.iterator().next().steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("kpxkqejtpjfoj", response.iterator().next().steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutWithResponseMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutWithResponseMockTests.java deleted file mode 100644 index d1d289e49b5f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutWithResponseMockTests.java +++ /dev/null @@ -1,114 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.fluent.models.Step; -import com.azure.resourcemanager.azurestackhci.models.UpdateRun; -import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdateRunsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - String responseStr - = "{\"location\":\"yyjshcybwfuppo\",\"properties\":{\"provisioningState\":\"Deleted\",\"timeStarted\":\"2021-07-04T04:46:54Z\",\"lastUpdatedTime\":\"2021-06-03T21:36:28Z\",\"duration\":\"jxdiikmoxrezsv\",\"state\":\"Succeeded\",\"progress\":{\"name\":\"ikj\",\"description\":\"ywlunpipcwybs\",\"errorMessage\":\"ncnpat\",\"status\":\"tsaebwfwhxorpwa\",\"startTimeUtc\":\"2021-06-16T08:15:31Z\",\"endTimeUtc\":\"2021-02-06T18:53Z\",\"lastUpdatedTimeUtc\":\"2021-06-24T13:27:14Z\",\"expectedExecutionTime\":\"ojfccylhtrht\",\"steps\":[{\"name\":\"jpwexcdrz\",\"description\":\"o\",\"errorMessage\":\"zxezmnr\",\"status\":\"gpjeuxsphlokfp\",\"startTimeUtc\":\"2021-04-01T17:54:10Z\",\"endTimeUtc\":\"2021-07-25T23:33:25Z\",\"lastUpdatedTimeUtc\":\"2021-09-27T10:36:11Z\",\"expectedExecutionTime\":\"fbhwbdqufvc\",\"steps\":[{}]},{\"name\":\"laqrwyam\",\"description\":\"bafeb\",\"errorMessage\":\"fk\",\"status\":\"utibhlen\",\"startTimeUtc\":\"2021-04-04T14:20:23Z\",\"endTimeUtc\":\"2021-02-01T02:39:45Z\",\"lastUpdatedTimeUtc\":\"2021-03-04T14:33:22Z\",\"expectedExecutionTime\":\"abdu\",\"steps\":[{},{}]},{\"name\":\"lghnysvlp\",\"description\":\"uukppdixqb\",\"errorMessage\":\"xvhhyqq\",\"status\":\"at\",\"startTimeUtc\":\"2021-12-07T11:56:56Z\",\"endTimeUtc\":\"2021-10-19T10:58:27Z\",\"lastUpdatedTimeUtc\":\"2021-09-24T13:47:14Z\",\"expectedExecutionTime\":\"nmtsdixc\",\"steps\":[{},{},{}]},{\"name\":\"bmgjymncjc\",\"description\":\"airwcqzoofj\",\"errorMessage\":\"jsvepfbhtleberp\",\"status\":\"jeknfqnw\",\"startTimeUtc\":\"2021-06-22T21:22:25Z\",\"endTimeUtc\":\"2021-12-06T21:58:15Z\",\"lastUpdatedTimeUtc\":\"2021-07-31T14:46:40Z\",\"expectedExecutionTime\":\"njrxgkrhwie\",\"steps\":[{},{}]}]}},\"id\":\"nowawonoehrguqlh\",\"name\":\"wafbjzmp\",\"type\":\"rguyfa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateRun response = manager.updateRuns() - .define("rcwgzwllxzlhhf") - .withExistingUpdate("mazdfsqxh", "qmr", "jparnpvgrszrbwt") - .withRegion("acfculzjrmhpf") - .withTimeStarted(OffsetDateTime.parse("2021-11-22T19:55:27Z")) - .withLastUpdatedTime(OffsetDateTime.parse("2021-02-20T02:04:38Z")) - .withDuration("fzxsoxinunjlzkd") - .withState(UpdateRunPropertiesState.FAILED) - .withNamePropertiesName("xytqq") - .withDescription("miwdwisvnme") - .withErrorMessage("ajamc") - .withStatus("yh") - .withStartTimeUtc(OffsetDateTime.parse("2021-02-08T06:18:05Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-04-13T15:26:33Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-12-01T11:59:37Z")) - .withExpectedExecutionTime("kll") - .withSteps(Arrays.asList( - new Step().withName("anhkigglclwalh") - .withDescription("bhgzphetxdq") - .withErrorMessage("yctajqz") - .withStatus("alec") - .withStartTimeUtc(OffsetDateTime.parse("2021-05-06T22:18:11Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-10-21T08:11:03Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-09-17T15:16:08Z")) - .withExpectedExecutionTime("degyxsbfpzvo") - .withSteps(Arrays.asList(new Step())), - new Step().withName("twczf") - .withDescription("ushlcxpblalh") - .withErrorMessage("zpfkis") - .withStatus("idqzsaaoqdsgpto") - .withStartTimeUtc(OffsetDateTime.parse("2021-03-27T14:06:37Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-01-27T18:55:40Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-10-22T00:46:28Z")) - .withExpectedExecutionTime("cnlrt") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())), - new Step().withName("zzcaoijolbuauk") - .withDescription("ieopexelxqdwr") - .withErrorMessage("yil") - .withStatus("ibkgxyxyau") - .withStartTimeUtc(OffsetDateTime.parse("2021-09-13T13:52:05Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-06-11T01:53:29Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-03-17T10:44:28Z")) - .withExpectedExecutionTime("cnlt") - .withSteps(Arrays.asList(new Step(), new Step())), - new Step().withName("kujsqycmm") - .withDescription("fablqg") - .withErrorMessage("bmwhrialiwr") - .withStatus("gnwplrrb") - .withStartTimeUtc(OffsetDateTime.parse("2021-09-20T03:31:15Z")) - .withEndTimeUtc(OffsetDateTime.parse("2021-08-26T04:38:01Z")) - .withLastUpdatedTimeUtc(OffsetDateTime.parse("2021-09-02T14:41:47Z")) - .withExpectedExecutionTime("bticuhqv") - .withSteps(Arrays.asList(new Step(), new Step(), new Step(), new Step())))) - .create(); - - Assertions.assertEquals("yyjshcybwfuppo", response.location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T04:46:54Z"), response.timeStarted()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T21:36:28Z"), response.lastUpdatedTime()); - Assertions.assertEquals("jxdiikmoxrezsv", response.duration()); - Assertions.assertEquals(UpdateRunPropertiesState.SUCCEEDED, response.state()); - Assertions.assertEquals("ikj", response.namePropertiesName()); - Assertions.assertEquals("ywlunpipcwybs", response.description()); - Assertions.assertEquals("ncnpat", response.errorMessage()); - Assertions.assertEquals("tsaebwfwhxorpwa", response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T08:15:31Z"), response.startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T18:53Z"), response.endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T13:27:14Z"), response.lastUpdatedTimeUtc()); - Assertions.assertEquals("ojfccylhtrht", response.expectedExecutionTime()); - Assertions.assertEquals("jpwexcdrz", response.steps().get(0).name()); - Assertions.assertEquals("o", response.steps().get(0).description()); - Assertions.assertEquals("zxezmnr", response.steps().get(0).errorMessage()); - Assertions.assertEquals("gpjeuxsphlokfp", response.steps().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-01T17:54:10Z"), response.steps().get(0).startTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-25T23:33:25Z"), response.steps().get(0).endTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T10:36:11Z"), - response.steps().get(0).lastUpdatedTimeUtc()); - Assertions.assertEquals("fbhwbdqufvc", response.steps().get(0).expectedExecutionTime()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateStatePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateStatePropertiesTests.java deleted file mode 100644 index d81926d4c877..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateStatePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateStateProperties; -import org.junit.jupiter.api.Assertions; - -public final class UpdateStatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateStateProperties model - = BinaryData.fromString("{\"progressPercentage\":75.61018,\"notifyMessage\":\"iwdcxsmlzzhzd\"}") - .toObject(UpdateStateProperties.class); - Assertions.assertEquals(75.61018F, model.progressPercentage()); - Assertions.assertEquals("iwdcxsmlzzhzd", model.notifyMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateStateProperties model - = new UpdateStateProperties().withProgressPercentage(75.61018F).withNotifyMessage("iwdcxsmlzzhzd"); - model = BinaryData.fromObject(model).toObject(UpdateStateProperties.class); - Assertions.assertEquals(75.61018F, model.progressPercentage()); - Assertions.assertEquals("iwdcxsmlzzhzd", model.notifyMessage()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesListTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesListTests.java deleted file mode 100644 index 5139fdbb06eb..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesListTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; -import com.azure.resourcemanager.azurestackhci.models.HealthState; -import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; -import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; -import com.azure.resourcemanager.azurestackhci.models.PrecheckResultTags; -import com.azure.resourcemanager.azurestackhci.models.Severity; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesList; -import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateSummariesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateSummariesList model = BinaryData.fromString( - "{\"value\":[{\"location\":\"fclduccbirdsv\",\"properties\":{\"provisioningState\":\"Creating\",\"oemFamily\":\"iegstm\",\"currentOemVersion\":\"nwjizcilnghgshej\",\"hardwareModel\":\"bxqmu\",\"packageVersions\":[{\"packageType\":\"xqzv\",\"version\":\"rsbycucrwn\",\"lastUpdated\":\"2021-01-22T04:44:02Z\"},{\"packageType\":\"ze\",\"version\":\"qbsms\",\"lastUpdated\":\"2021-07-12T06:31:29Z\"}],\"currentVersion\":\"gfuhokzrusw\",\"currentSbeVersion\":\"hczznvf\",\"lastUpdated\":\"2021-10-03T09:25:48Z\",\"lastChecked\":\"2021-12-08T17:30:41Z\",\"healthState\":\"Warning\",\"healthCheckResult\":[{\"name\":\"xzv\",\"displayName\":\"wmxqhndvnoamlds\",\"tags\":{},\"healthCheckTags\":\"dataohdjhhflzok\",\"title\":\"ox\",\"status\":\"ValidationSuccess\",\"severity\":\"Hidden\",\"description\":\"tag\",\"remediation\":\"sxoa\",\"targetResourceID\":\"tgzpnpb\",\"targetResourceName\":\"vefloccsrmozihmi\",\"targetResourceType\":\"awtxxpk\",\"timestamp\":\"2021-06-09T22:40:53Z\",\"additionalData\":\"cjxgrytf\",\"healthCheckSource\":\"cy\"}],\"healthCheckDate\":\"2021-02-23T15:17:22Z\",\"state\":\"UpdateAvailable\"},\"id\":\"aykggnoxu\",\"name\":\"t\",\"type\":\"ksxwpnd\"},{\"location\":\"pfnznthjtwkj\",\"properties\":{\"provisioningState\":\"Canceled\",\"oemFamily\":\"uzvoamktcqiosm\",\"currentOemVersion\":\"zah\",\"hardwareModel\":\"qdlyrtl\",\"packageVersions\":[{\"packageType\":\"rltzkatbhjmz\",\"version\":\"bsoqeqala\",\"lastUpdated\":\"2021-09-27T21:31:23Z\"}],\"currentVersion\":\"gunbtgfebwlnbm\",\"currentSbeVersion\":\"reeudzqavb\",\"lastUpdated\":\"2021-04-18T03:24:53Z\",\"lastChecked\":\"2021-05-03T15:28:46Z\",\"healthState\":\"Success\",\"healthCheckResult\":[{\"name\":\"glgou\",\"displayName\":\"lmjjyuo\",\"tags\":{},\"healthCheckTags\":\"dataobaxkjeytu\",\"title\":\"bfjkw\",\"status\":\"NotConnectedRecently\",\"severity\":\"Critical\",\"description\":\"bhsy\",\"remediation\":\"unjqh\",\"targetResourceID\":\"nxaulk\",\"targetResourceName\":\"kdk\",\"targetResourceType\":\"mjnnawtq\",\"timestamp\":\"2021-03-05T00:10:25Z\",\"additionalData\":\"uckpggqoweyir\",\"healthCheckSource\":\"lisn\"},{\"name\":\"fl\",\"displayName\":\"mpizru\",\"tags\":{},\"healthCheckTags\":\"dataqxpxiwfcngjsaa\",\"title\":\"ixtmkzjvkviirhgf\",\"status\":\"ValidationSuccess\",\"severity\":\"Warning\",\"description\":\"gratzvzbglbyvict\",\"remediation\":\"brxkjzwr\",\"targetResourceID\":\"ffm\",\"targetResourceName\":\"kwfbkgo\",\"targetResourceType\":\"wopdbydpiz\",\"timestamp\":\"2021-11-06T08:13:32Z\",\"additionalData\":\"napxbiygnug\",\"healthCheckSource\":\"nfsm\"}],\"healthCheckDate\":\"2020-12-29T23:37:42Z\",\"state\":\"UpdateFailed\"},\"id\":\"uuyilfl\",\"name\":\"oiquvrehmrnjhvs\",\"type\":\"jztczytqj\"},{\"location\":\"h\",\"properties\":{\"provisioningState\":\"Creating\",\"oemFamily\":\"prnjletlxsmr\",\"currentOemVersion\":\"do\",\"hardwareModel\":\"fa\",\"packageVersions\":[{\"packageType\":\"z\",\"version\":\"nknlqwzdvpi\",\"lastUpdated\":\"2021-05-20T09:01:05Z\"},{\"packageType\":\"szdtmaajquh\",\"version\":\"ylr\",\"lastUpdated\":\"2021-05-27T06:37:19Z\"}],\"currentVersion\":\"ygjbmzyospspsh\",\"currentSbeVersion\":\"fkyjpmspbpssdfpp\",\"lastUpdated\":\"2021-03-29T12:30:22Z\",\"lastChecked\":\"2021-07-23T05:28:51Z\",\"healthState\":\"Error\",\"healthCheckResult\":[{\"name\":\"vczkcnyxrxmunjd\",\"displayName\":\"glnkvxlxpagl\",\"tags\":{},\"healthCheckTags\":\"databgkc\",\"title\":\"hpzvuqdflvoniyp\",\"status\":\"NotYetRegistered\",\"severity\":\"Informational\",\"description\":\"zgp\",\"remediation\":\"ivhjknidi\",\"targetResourceID\":\"qjxgpnrhgovfgp\",\"targetResourceName\":\"qmhhaowj\",\"targetResourceType\":\"zvuporqzdfuydz\",\"timestamp\":\"2021-03-31T13:08:16Z\",\"additionalData\":\"xcnqmxqpswokmvkh\",\"healthCheckSource\":\"gdhbe\"},{\"name\":\"qkzszuwiwtglxxh\",\"displayName\":\"fpgpicrmnzhrgm\",\"tags\":{},\"healthCheckTags\":\"datasxvpqcbfrmbodths\",\"title\":\"gvriibakclac\",\"status\":\"DeploymentInProgress\",\"severity\":\"Informational\",\"description\":\"usx\",\"remediation\":\"zlwvsgmwohqfz\",\"targetResourceID\":\"vux\",\"targetResourceName\":\"kjsvthnwpzteko\",\"targetResourceType\":\"ribi\",\"timestamp\":\"2021-06-09T12:18:35Z\",\"additionalData\":\"plucfotangcfhnyk\",\"healthCheckSource\":\"ugswvx\"},{\"name\":\"mzqwmvtxnjmxmcu\",\"displayName\":\"dtcvcl\",\"tags\":{},\"healthCheckTags\":\"datapdkvg\",\"title\":\"buiyji\",\"status\":\"NotSpecified\",\"severity\":\"Informational\",\"description\":\"ugneikn\",\"remediation\":\"oxgjiuqhibt\",\"targetResourceID\":\"ipq\",\"targetResourceName\":\"edmurrxxge\",\"targetResourceType\":\"ktvqylkmqpzoy\",\"timestamp\":\"2021-06-19T06:46:21Z\",\"additionalData\":\"cgwgcloxoebqinji\",\"healthCheckSource\":\"wjfuj\"},{\"name\":\"afcba\",\"displayName\":\"pzpofoiyjw\",\"tags\":{},\"healthCheckTags\":\"datalkmkkholvdndvi\",\"title\":\"ogphuartvtiu\",\"status\":\"DeploymentFailed\",\"severity\":\"Warning\",\"description\":\"nmnahmnx\",\"remediation\":\"xjqirwrweoox\",\"targetResourceID\":\"i\",\"targetResourceName\":\"xwrsnew\",\"targetResourceType\":\"zqvbubqm\",\"timestamp\":\"2021-05-14T02:53:04Z\",\"additionalData\":\"ycxhxzgaztta\",\"healthCheckSource\":\"idvmfqhppubo\"}],\"healthCheckDate\":\"2021-04-23T03:49:20Z\",\"state\":\"UpdateInProgress\"},\"id\":\"g\",\"name\":\"mtdherngb\",\"type\":\"c\"}],\"nextLink\":\"ahokqtobkauxofsh\"}") - .toObject(UpdateSummariesList.class); - Assertions.assertEquals("fclduccbirdsv", model.value().get(0).location()); - Assertions.assertEquals("iegstm", model.value().get(0).oemFamily()); - Assertions.assertEquals("nwjizcilnghgshej", model.value().get(0).currentOemVersion()); - Assertions.assertEquals("bxqmu", model.value().get(0).hardwareModel()); - Assertions.assertEquals("xqzv", model.value().get(0).packageVersions().get(0).packageType()); - Assertions.assertEquals("rsbycucrwn", model.value().get(0).packageVersions().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T04:44:02Z"), - model.value().get(0).packageVersions().get(0).lastUpdated()); - Assertions.assertEquals("gfuhokzrusw", model.value().get(0).currentVersion()); - Assertions.assertEquals("hczznvf", model.value().get(0).currentSbeVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T09:25:48Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T17:30:41Z"), model.value().get(0).lastChecked()); - Assertions.assertEquals(HealthState.WARNING, model.value().get(0).healthState()); - Assertions.assertEquals("xzv", model.value().get(0).healthCheckResult().get(0).name()); - Assertions.assertEquals("wmxqhndvnoamlds", model.value().get(0).healthCheckResult().get(0).displayName()); - Assertions.assertEquals("ox", model.value().get(0).healthCheckResult().get(0).title()); - Assertions.assertEquals(Status.VALIDATION_SUCCESS, model.value().get(0).healthCheckResult().get(0).status()); - Assertions.assertEquals(Severity.HIDDEN, model.value().get(0).healthCheckResult().get(0).severity()); - Assertions.assertEquals("tag", model.value().get(0).healthCheckResult().get(0).description()); - Assertions.assertEquals("sxoa", model.value().get(0).healthCheckResult().get(0).remediation()); - Assertions.assertEquals("tgzpnpb", model.value().get(0).healthCheckResult().get(0).targetResourceId()); - Assertions.assertEquals("vefloccsrmozihmi", - model.value().get(0).healthCheckResult().get(0).targetResourceName()); - Assertions.assertEquals("awtxxpk", model.value().get(0).healthCheckResult().get(0).targetResourceType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T22:40:53Z"), - model.value().get(0).healthCheckResult().get(0).timestamp()); - Assertions.assertEquals("cjxgrytf", model.value().get(0).healthCheckResult().get(0).additionalData()); - Assertions.assertEquals("cy", model.value().get(0).healthCheckResult().get(0).healthCheckSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T15:17:22Z"), model.value().get(0).healthCheckDate()); - Assertions.assertEquals(UpdateSummariesPropertiesState.UPDATE_AVAILABLE, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSummariesList model = new UpdateSummariesList().withValue(Arrays.asList( - new UpdateSummariesInner().withLocation("fclduccbirdsv") - .withOemFamily("iegstm") - .withCurrentOemVersion("nwjizcilnghgshej") - .withHardwareModel("bxqmu") - .withPackageVersions(Arrays.asList( - new PackageVersionInfo().withPackageType("xqzv") - .withVersion("rsbycucrwn") - .withLastUpdated(OffsetDateTime.parse("2021-01-22T04:44:02Z")), - new PackageVersionInfo().withPackageType("ze") - .withVersion("qbsms") - .withLastUpdated(OffsetDateTime.parse("2021-07-12T06:31:29Z")))) - .withCurrentVersion("gfuhokzrusw") - .withCurrentSbeVersion("hczznvf") - .withLastUpdated(OffsetDateTime.parse("2021-10-03T09:25:48Z")) - .withLastChecked(OffsetDateTime.parse("2021-12-08T17:30:41Z")) - .withHealthState(HealthState.WARNING) - .withHealthCheckResult(Arrays.asList(new PrecheckResult().withName("xzv") - .withDisplayName("wmxqhndvnoamlds") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("dataohdjhhflzok") - .withTitle("ox") - .withStatus(Status.VALIDATION_SUCCESS) - .withSeverity(Severity.HIDDEN) - .withDescription("tag") - .withRemediation("sxoa") - .withTargetResourceId("tgzpnpb") - .withTargetResourceName("vefloccsrmozihmi") - .withTargetResourceType("awtxxpk") - .withTimestamp(OffsetDateTime.parse("2021-06-09T22:40:53Z")) - .withAdditionalData("cjxgrytf") - .withHealthCheckSource("cy"))) - .withHealthCheckDate(OffsetDateTime.parse("2021-02-23T15:17:22Z")) - .withState(UpdateSummariesPropertiesState.UPDATE_AVAILABLE), - new UpdateSummariesInner().withLocation("pfnznthjtwkj") - .withOemFamily("uzvoamktcqiosm") - .withCurrentOemVersion("zah") - .withHardwareModel("qdlyrtl") - .withPackageVersions(Arrays.asList(new PackageVersionInfo().withPackageType("rltzkatbhjmz") - .withVersion("bsoqeqala") - .withLastUpdated(OffsetDateTime.parse("2021-09-27T21:31:23Z")))) - .withCurrentVersion("gunbtgfebwlnbm") - .withCurrentSbeVersion("reeudzqavb") - .withLastUpdated(OffsetDateTime.parse("2021-04-18T03:24:53Z")) - .withLastChecked(OffsetDateTime.parse("2021-05-03T15:28:46Z")) - .withHealthState(HealthState.SUCCESS) - .withHealthCheckResult(Arrays.asList( - new PrecheckResult().withName("glgou") - .withDisplayName("lmjjyuo") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("dataobaxkjeytu") - .withTitle("bfjkw") - .withStatus(Status.NOT_CONNECTED_RECENTLY) - .withSeverity(Severity.CRITICAL) - .withDescription("bhsy") - .withRemediation("unjqh") - .withTargetResourceId("nxaulk") - .withTargetResourceName("kdk") - .withTargetResourceType("mjnnawtq") - .withTimestamp(OffsetDateTime.parse("2021-03-05T00:10:25Z")) - .withAdditionalData("uckpggqoweyir") - .withHealthCheckSource("lisn"), - new PrecheckResult().withName("fl") - .withDisplayName("mpizru") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("dataqxpxiwfcngjsaa") - .withTitle("ixtmkzjvkviirhgf") - .withStatus(Status.VALIDATION_SUCCESS) - .withSeverity(Severity.WARNING) - .withDescription("gratzvzbglbyvict") - .withRemediation("brxkjzwr") - .withTargetResourceId("ffm") - .withTargetResourceName("kwfbkgo") - .withTargetResourceType("wopdbydpiz") - .withTimestamp(OffsetDateTime.parse("2021-11-06T08:13:32Z")) - .withAdditionalData("napxbiygnug") - .withHealthCheckSource("nfsm"))) - .withHealthCheckDate(OffsetDateTime.parse("2020-12-29T23:37:42Z")) - .withState(UpdateSummariesPropertiesState.UPDATE_FAILED), - new UpdateSummariesInner().withLocation("h") - .withOemFamily("prnjletlxsmr") - .withCurrentOemVersion("do") - .withHardwareModel("fa") - .withPackageVersions(Arrays.asList( - new PackageVersionInfo().withPackageType("z") - .withVersion("nknlqwzdvpi") - .withLastUpdated(OffsetDateTime.parse("2021-05-20T09:01:05Z")), - new PackageVersionInfo().withPackageType("szdtmaajquh") - .withVersion("ylr") - .withLastUpdated(OffsetDateTime.parse("2021-05-27T06:37:19Z")))) - .withCurrentVersion("ygjbmzyospspsh") - .withCurrentSbeVersion("fkyjpmspbpssdfpp") - .withLastUpdated(OffsetDateTime.parse("2021-03-29T12:30:22Z")) - .withLastChecked(OffsetDateTime.parse("2021-07-23T05:28:51Z")) - .withHealthState(HealthState.ERROR) - .withHealthCheckResult(Arrays.asList( - new PrecheckResult().withName("vczkcnyxrxmunjd") - .withDisplayName("glnkvxlxpagl") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("databgkc") - .withTitle("hpzvuqdflvoniyp") - .withStatus(Status.NOT_YET_REGISTERED) - .withSeverity(Severity.INFORMATIONAL) - .withDescription("zgp") - .withRemediation("ivhjknidi") - .withTargetResourceId("qjxgpnrhgovfgp") - .withTargetResourceName("qmhhaowj") - .withTargetResourceType("zvuporqzdfuydz") - .withTimestamp(OffsetDateTime.parse("2021-03-31T13:08:16Z")) - .withAdditionalData("xcnqmxqpswokmvkh") - .withHealthCheckSource("gdhbe"), - new PrecheckResult().withName("qkzszuwiwtglxxh") - .withDisplayName("fpgpicrmnzhrgm") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datasxvpqcbfrmbodths") - .withTitle("gvriibakclac") - .withStatus(Status.DEPLOYMENT_IN_PROGRESS) - .withSeverity(Severity.INFORMATIONAL) - .withDescription("usx") - .withRemediation("zlwvsgmwohqfz") - .withTargetResourceId("vux") - .withTargetResourceName("kjsvthnwpzteko") - .withTargetResourceType("ribi") - .withTimestamp(OffsetDateTime.parse("2021-06-09T12:18:35Z")) - .withAdditionalData("plucfotangcfhnyk") - .withHealthCheckSource("ugswvx"), - new PrecheckResult().withName("mzqwmvtxnjmxmcu") - .withDisplayName("dtcvcl") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datapdkvg") - .withTitle("buiyji") - .withStatus(Status.NOT_SPECIFIED) - .withSeverity(Severity.INFORMATIONAL) - .withDescription("ugneikn") - .withRemediation("oxgjiuqhibt") - .withTargetResourceId("ipq") - .withTargetResourceName("edmurrxxge") - .withTargetResourceType("ktvqylkmqpzoy") - .withTimestamp(OffsetDateTime.parse("2021-06-19T06:46:21Z")) - .withAdditionalData("cgwgcloxoebqinji") - .withHealthCheckSource("wjfuj"), - new PrecheckResult().withName("afcba") - .withDisplayName("pzpofoiyjw") - .withTags(new PrecheckResultTags()) - .withHealthCheckTags("datalkmkkholvdndvi") - .withTitle("ogphuartvtiu") - .withStatus(Status.DEPLOYMENT_FAILED) - .withSeverity(Severity.WARNING) - .withDescription("nmnahmnx") - .withRemediation("xjqirwrweoox") - .withTargetResourceId("i") - .withTargetResourceName("xwrsnew") - .withTargetResourceType("zqvbubqm") - .withTimestamp(OffsetDateTime.parse("2021-05-14T02:53:04Z")) - .withAdditionalData("ycxhxzgaztta") - .withHealthCheckSource("idvmfqhppubo"))) - .withHealthCheckDate(OffsetDateTime.parse("2021-04-23T03:49:20Z")) - .withState(UpdateSummariesPropertiesState.UPDATE_IN_PROGRESS))); - model = BinaryData.fromObject(model).toObject(UpdateSummariesList.class); - Assertions.assertEquals("fclduccbirdsv", model.value().get(0).location()); - Assertions.assertEquals("iegstm", model.value().get(0).oemFamily()); - Assertions.assertEquals("nwjizcilnghgshej", model.value().get(0).currentOemVersion()); - Assertions.assertEquals("bxqmu", model.value().get(0).hardwareModel()); - Assertions.assertEquals("xqzv", model.value().get(0).packageVersions().get(0).packageType()); - Assertions.assertEquals("rsbycucrwn", model.value().get(0).packageVersions().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T04:44:02Z"), - model.value().get(0).packageVersions().get(0).lastUpdated()); - Assertions.assertEquals("gfuhokzrusw", model.value().get(0).currentVersion()); - Assertions.assertEquals("hczznvf", model.value().get(0).currentSbeVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T09:25:48Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T17:30:41Z"), model.value().get(0).lastChecked()); - Assertions.assertEquals(HealthState.WARNING, model.value().get(0).healthState()); - Assertions.assertEquals("xzv", model.value().get(0).healthCheckResult().get(0).name()); - Assertions.assertEquals("wmxqhndvnoamlds", model.value().get(0).healthCheckResult().get(0).displayName()); - Assertions.assertEquals("ox", model.value().get(0).healthCheckResult().get(0).title()); - Assertions.assertEquals(Status.VALIDATION_SUCCESS, model.value().get(0).healthCheckResult().get(0).status()); - Assertions.assertEquals(Severity.HIDDEN, model.value().get(0).healthCheckResult().get(0).severity()); - Assertions.assertEquals("tag", model.value().get(0).healthCheckResult().get(0).description()); - Assertions.assertEquals("sxoa", model.value().get(0).healthCheckResult().get(0).remediation()); - Assertions.assertEquals("tgzpnpb", model.value().get(0).healthCheckResult().get(0).targetResourceId()); - Assertions.assertEquals("vefloccsrmozihmi", - model.value().get(0).healthCheckResult().get(0).targetResourceName()); - Assertions.assertEquals("awtxxpk", model.value().get(0).healthCheckResult().get(0).targetResourceType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T22:40:53Z"), - model.value().get(0).healthCheckResult().get(0).timestamp()); - Assertions.assertEquals("cjxgrytf", model.value().get(0).healthCheckResult().get(0).additionalData()); - Assertions.assertEquals("cy", model.value().get(0).healthCheckResult().get(0).healthCheckSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T15:17:22Z"), model.value().get(0).healthCheckDate()); - Assertions.assertEquals(UpdateSummariesPropertiesState.UPDATE_AVAILABLE, model.value().get(0).state()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationsDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationsDeleteMockTests.java deleted file mode 100644 index c1db70fd00e9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationsDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdateSummariesOperationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.updateSummariesOperations().delete("fqayopbtsix", "gvbhxmndztgs", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteMockTests.java deleted file mode 100644 index c25934aea021..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdatesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.updates().delete("pnml", "iqcpszpmcvq", "vrdmvxyrxdh", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostMockTests.java deleted file mode 100644 index 84baa31431e0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UpdatesPostMockTests { - @Test - public void testPost() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureStackHciManager manager = AzureStackHciManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.updates().post("cybdueurgm", "dcpks", "lojermhzicsbfd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UploadCertificateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UploadCertificateRequestTests.java deleted file mode 100644 index d4f38f430a4b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UploadCertificateRequestTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; -import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UploadCertificateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UploadCertificateRequest model - = BinaryData.fromString("{\"properties\":{\"certificates\":[\"isgwbnbbeldawkz\",\"ali\"]}}") - .toObject(UploadCertificateRequest.class); - Assertions.assertEquals("isgwbnbbeldawkz", model.properties().certificates().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UploadCertificateRequest model = new UploadCertificateRequest() - .withProperties(new RawCertificateData().withCertificates(Arrays.asList("isgwbnbbeldawkz", "ali"))); - model = BinaryData.fromObject(model).toObject(UploadCertificateRequest.class); - Assertions.assertEquals("isgwbnbbeldawkz", model.properties().certificates().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UserAssignedIdentityTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UserAssignedIdentityTests.java deleted file mode 100644 index ccb621a272af..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +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.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"7072640a-2e6c-4cbc-8a6f-cd0382bd7ee1\",\"clientId\":\"9ba6fe17-b9ab-4adb-8d77-54bf995c2ddc\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateRequestTests.java deleted file mode 100644 index fd99c0c9a301..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateRequestTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ValidateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateRequest model = BinaryData.fromString( - "{\"edgeDeviceIds\":[\"xtqmieoxor\",\"gufhyaomtbg\",\"havgrvk\"],\"additionalInfo\":\"ovjzhpjbibgjmfx\"}") - .toObject(ValidateRequest.class); - Assertions.assertEquals("xtqmieoxor", model.edgeDeviceIds().get(0)); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.additionalInfo()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateRequest model - = new ValidateRequest().withEdgeDeviceIds(Arrays.asList("xtqmieoxor", "gufhyaomtbg", "havgrvk")) - .withAdditionalInfo("ovjzhpjbibgjmfx"); - model = BinaryData.fromObject(model).toObject(ValidateRequest.class); - Assertions.assertEquals("xtqmieoxor", model.edgeDeviceIds().get(0)); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.additionalInfo()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateResponseInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateResponseInnerTests.java deleted file mode 100644 index 126424668c59..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ValidateResponseInnerTests.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.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; - -public final class ValidateResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateResponseInner model - = BinaryData.fromString("{\"status\":\"vfcluyovwxnbkfe\"}").toObject(ValidateResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateResponseInner model = new ValidateResponseInner(); - model = BinaryData.fromObject(model).toObject(ValidateResponseInner.class); - } -}