diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 1f3065c5c4d0..6d67bc63783a 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.5 (Unreleased) +## 1.0.0-beta.1 (2024-07-15) + +- 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 08f0b785e734..1bb8613c19bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-preview-2023-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for 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.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 232130de49e5..0ab2357eb012 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -1,6 +1,54 @@ # Code snippets and samples +## ArcSettings + +- [ConsentAndInstallDefaultExtensions](#arcsettings_consentandinstalldefaultextensions) +- [Create](#arcsettings_create) +- [CreateIdentity](#arcsettings_createidentity) +- [Delete](#arcsettings_delete) +- [GeneratePassword](#arcsettings_generatepassword) +- [Get](#arcsettings_get) +- [InitializeDisableProcess](#arcsettings_initializedisableprocess) +- [ListByCluster](#arcsettings_listbycluster) +- [Update](#arcsettings_update) + +## Clusters + +- [Create](#clusters_create) +- [CreateIdentity](#clusters_createidentity) +- [Delete](#clusters_delete) +- [ExtendSoftwareAssuranceBenefit](#clusters_extendsoftwareassurancebenefit) +- [GetByResourceGroup](#clusters_getbyresourcegroup) +- [List](#clusters_list) +- [ListByResourceGroup](#clusters_listbyresourcegroup) +- [Update](#clusters_update) +- [UploadCertificate](#clusters_uploadcertificate) + +## DeploymentSettings + +- [CreateOrUpdate](#deploymentsettings_createorupdate) +- [Delete](#deploymentsettings_delete) +- [Get](#deploymentsettings_get) +- [ListByClusters](#deploymentsettings_listbyclusters) + +## EdgeDevices + +- [CreateOrUpdate](#edgedevices_createorupdate) +- [Delete](#edgedevices_delete) +- [Get](#edgedevices_get) +- [List](#edgedevices_list) +- [Validate](#edgedevices_validate) + +## Extensions + +- [Create](#extensions_create) +- [Delete](#extensions_delete) +- [Get](#extensions_get) +- [ListByArcSetting](#extensions_listbyarcsetting) +- [Update](#extensions_update) +- [Upgrade](#extensions_upgrade) + ## GalleryImagesOperation - [CreateOrUpdate](#galleryimagesoperation_createorupdate) @@ -52,10 +100,33 @@ - [ListByResourceGroup](#networkinterfacesoperation_listbyresourcegroup) - [Update](#networkinterfacesoperation_update) +## Offers + +- [Get](#offers_get) +- [ListByCluster](#offers_listbycluster) +- [ListByPublisher](#offers_listbypublisher) + ## Operations - [List](#operations_list) +## Publishers + +- [Get](#publishers_get) +- [ListByCluster](#publishers_listbycluster) + +## SecuritySettings + +- [CreateOrUpdate](#securitysettings_createorupdate) +- [Delete](#securitysettings_delete) +- [Get](#securitysettings_get) +- [ListByClusters](#securitysettings_listbyclusters) + +## Skus + +- [Get](#skus_get) +- [ListByOffer](#skus_listbyoffer) + ## StorageContainersOperation - [CreateOrUpdate](#storagecontainersoperation_createorupdate) @@ -65,6 +136,28 @@ - [ListByResourceGroup](#storagecontainersoperation_listbyresourcegroup) - [Update](#storagecontainersoperation_update) +## UpdateRuns + +- [Delete](#updateruns_delete) +- [Get](#updateruns_get) +- [List](#updateruns_list) +- [Put](#updateruns_put) + +## UpdateSummariesOperation + +- [Delete](#updatesummariesoperation_delete) +- [Get](#updatesummariesoperation_get) +- [List](#updatesummariesoperation_list) +- [Put](#updatesummariesoperation_put) + +## Updates + +- [Delete](#updates_delete) +- [Get](#updates_get) +- [List](#updates_list) +- [Post](#updates_post) +- [Put](#updates_put) + ## VirtualHardDisksOperation - [CreateOrUpdate](#virtualharddisksoperation_createorupdate) @@ -84,147 +177,449 @@ - [Start](#virtualmachineinstances_start) - [Stop](#virtualmachineinstances_stop) - [Update](#virtualmachineinstances_update) -### GalleryImagesOperation_CreateOrUpdate +### ArcSettings_ConsentAndInstallDefaultExtensions ```java -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +/** + * Samples for ArcSettings ConsentAndInstallDefaultExtensions. + */ +public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + consentAndInstallDefaultExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings() + .consentAndInstallDefaultExtensionsWithResponse("test-rg", "myCluster", "default", + com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for GalleryImagesOperation CreateOrUpdate. */ -public final class GalleryImagesOperationCreateOrUpdateSamples { +### ArcSettings_Create + +```java +/** + * Samples for ArcSettings Create. + */ +public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutArcSetting. + * json */ /** - * Sample code: PutGalleryImage. - * + * Sample code: Create ArcSetting. + * * @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") + public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); + } +} +``` + +### ArcSettings_CreateIdentity + +```java +/** + * Samples for ArcSettings CreateIdentity. + */ +public final class ArcSettingsCreateIdentitySamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateArcIdentity + * .json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_Delete + +```java +/** + * Samples for ArcSettings Delete. + */ +public final class ArcSettingsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteArcSetting. + * json + */ + /** + * Sample code: Delete ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_GeneratePassword + +```java +/** + * Samples for ArcSettings GeneratePassword. + */ +public final class ArcSettingsGeneratePasswordSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GeneratePassword. + * json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings() + .generatePasswordWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_Get + +```java +/** + * Samples for ArcSettings Get. + */ +public final class ArcSettingsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetArcSetting. + * json + */ + /** + * Sample code: Get ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_InitializeDisableProcess + +```java +/** + * Samples for ArcSettings InitializeDisableProcess. + */ +public final class ArcSettingsInitializeDisableProcessSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * InitializeDisableProcess.json + */ + /** + * Sample code: Trigger ARC Disable. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings() + .initializeDisableProcess("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_ListByCluster + +```java +/** + * Samples for ArcSettings ListByCluster. + */ +public final class ArcSettingsListByClusterSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + listArcSettingResourcesByHCICluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### ArcSettings_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import java.io.IOException; + +/** + * Samples for ArcSettings Update. + */ +public final class ArcSettingsUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchArcSetting. + * json + */ + /** + * Sample code: Patch ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + ArcSetting resource = manager.arcSettings() + .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withConnectivityProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"enabled\":true,\"serviceConfigurations\":[{\"port\":6516,\"serviceName\":\"WAC\"}]}", + Object.class, SerializerEncoding.JSON)) + .apply(); + } +} +``` + +### Clusters_Create + +```java +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; + +/** + * Samples for Clusters Create. + */ +public final class ClustersCreateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateCluster. + * json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .define("myCluster") + .withRegion("East US") .withExistingResourceGroup("test-rg") - .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) + .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") + .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") .create(); } } ``` -### GalleryImagesOperation_Delete +### Clusters_CreateIdentity ```java -/** Samples for GalleryImagesOperation Delete. */ -public final class GalleryImagesOperationDeleteSamples { +/** + * Samples for Clusters CreateIdentity. + */ +public final class ClustersCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * CreateClusterIdentity.json */ /** - * Sample code: DeleteGalleryImage. - * + * Sample code: Create cluster Identity. + * * @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); + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().createIdentity("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### GalleryImagesOperation_GetByResourceGroup +### Clusters_Delete ```java -/** Samples for GalleryImagesOperation GetByResourceGroup. */ -public final class GalleryImagesOperationGetByResourceGroupSamples { +/** + * Samples for Clusters Delete. + */ +public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteCluster. + * json */ /** - * Sample code: GetGalleryImage. - * + * Sample code: Delete cluster. + * * @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); + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().delete("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### GalleryImagesOperation_List +### Clusters_ExtendSoftwareAssuranceBenefit ```java -/** Samples for GalleryImagesOperation List. */ -public final class GalleryImagesOperationListSamples { +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; + +/** + * Samples for Clusters ExtendSoftwareAssuranceBenefit. + */ +public final class ClustersExtendSoftwareAssuranceBenefitSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageBySubscription.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ExtendSoftwareAssuranceBenefit.json */ /** - * Sample code: ListGalleryImageBySubscription. - * + * Sample code: Create cluster Identity. + * * @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); + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .extendSoftwareAssuranceBenefit("test-rg", "myCluster", + new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() + .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)), + com.azure.core.util.Context.NONE); } } ``` -### GalleryImagesOperation_ListByResourceGroup +### Clusters_GetByResourceGroup ```java -/** Samples for GalleryImagesOperation ListByResourceGroup. */ -public final class GalleryImagesOperationListByResourceGroupSamples { +/** + * Samples for Clusters GetByResourceGroup. + */ +public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageByResourceGroup.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetCluster.json */ /** - * Sample code: ListGalleryImageByResourceGroup. - * + * Sample code: Get cluster. + * * @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); + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### GalleryImagesOperation_Update +### Clusters_List ```java -import com.azure.resourcemanager.azurestackhci.models.GalleryImages; +/** + * Samples for Clusters List. + */ +public final class ClustersListSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + listClustersInAGivenSubscription(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_ListByResourceGroup + +```java +/** + * Samples for Clusters ListByResourceGroup. + */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + listClustersInAGivenResourceGroup(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Update + +```java +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.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; import java.util.HashMap; import java.util.Map; -/** Samples for GalleryImagesOperation Update. */ -public final class GalleryImagesOperationUpdateSamples { +/** + * Samples for Clusters Update. + */ +public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateCluster. + * json */ /** - * Sample code: UpdateGalleryImage. - * + * Sample code: Update cluster. + * * @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(); + 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(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withDesiredProperties( + new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.ENABLED) + .withDiagnosticLevel(DiagnosticLevel.BASIC)) + .apply(); } // Use "Map.of" if available @@ -241,465 +636,1862 @@ public final class GalleryImagesOperationUpdateSamples { } ``` -### GuestAgent_Create +### Clusters_UploadCertificate ```java -import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; -import com.azure.resourcemanager.azurestackhci.models.GuestCredential; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; -/** Samples for GuestAgent Create. */ -public final class GuestAgentCreateSamples { +/** + * Samples for Clusters UploadCertificate. + */ +public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/CreateGuestAgent.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UploadCertificate + * .json */ /** - * Sample code: CreateGuestAgent. - * + * Sample code: Upload certificate. + * * @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), + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .uploadCertificate("test-rg", "myCluster", + new UploadCertificateRequest().withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), com.azure.core.util.Context.NONE); } } ``` -### GuestAgent_Delete +### DeploymentSettings_CreateOrUpdate ```java -/** Samples for GuestAgent Delete. */ -public final class GuestAgentDeleteSamples { +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.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.Observability; +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.ScaleUnits; +import com.azure.resourcemanager.azurestackhci.models.Storage; +import com.azure.resourcemanager.azurestackhci.models.StorageNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualSwitchConfigurationOverrides; +import java.util.Arrays; + +/** + * Samples for DeploymentSettings CreateOrUpdate. + */ +public final class DeploymentSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGuestAgent.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutDeploymentSettings.json */ /** - * Sample code: DeleteGuestAgent. - * + * Sample code: Create Deployment Settings. + * * @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); + public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.deploymentSettings() + .define("default") + .withExistingCluster("test-rg", "myCluster") + .withArcNodeResourceIds(Arrays.asList( + "/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) + .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(); } } ``` -### GuestAgent_Get +### DeploymentSettings_Delete ```java -/** Samples for GuestAgent Get. */ -public final class GuestAgentGetSamples { +/** + * Samples for DeploymentSettings Delete. + */ +public final class DeploymentSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGuestAgent.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteDeploymentSettings.json */ /** - * Sample code: GetGuestAgent. - * + * Sample code: Delete Deployment Settings. + * * @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); + public static void deleteDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.deploymentSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` -### GuestAgentsOperation_List +### DeploymentSettings_Get ```java -/** Samples for GuestAgentsOperation List. */ -public final class GuestAgentsOperationListSamples { +/** + * Samples for DeploymentSettings Get. + */ +public final class DeploymentSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GuestAgent_List.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetDeploymentSettings.json */ /** - * Sample code: GuestAgentListByVirtualMachineInstances. - * + * Sample code: Get Deployment Settings. + * * @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); + public static void getDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.deploymentSettings() + .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` -### HybridIdentityMetadata_Get +### DeploymentSettings_ListByClusters ```java -/** Samples for HybridIdentityMetadata Get. */ -public final class HybridIdentityMetadataGetSamples { +/** + * Samples for DeploymentSettings ListByClusters. + */ +public final class DeploymentSettingsListByClustersSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetHybridIdentityMetadata.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListDeploymentSettingsByCluster.json */ /** - * Sample code: GetHybridIdentityMetadata. - * + * Sample code: List Deployment Settings. + * * @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); + public static void listDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.deploymentSettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### HybridIdentityMetadata_List +### EdgeDevices_CreateOrUpdate ```java -/** Samples for HybridIdentityMetadata List. */ -public final class HybridIdentityMetadataListSamples { +import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NicDetail; +import java.util.Arrays; + +/** + * Samples for EdgeDevices CreateOrUpdate. + */ +public final class EdgeDevicesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/HybridIdentityMetadata_List.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutEdgeDevices. + * json */ /** - * Sample code: HybridIdentityMetadataListByVirtualMachineInstances. - * + * Sample code: Create Edge Device. + * * @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); + public static void createEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.edgeDevices() + .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(); + } +} +``` + +### EdgeDevices_Delete + +```java +/** + * Samples for EdgeDevices Delete. + */ +public final class EdgeDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteEdgeDevices + * .json + */ + /** + * Sample code: Delete Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeDevices_Get + +```java +/** + * Samples for EdgeDevices Get. + */ +public final class EdgeDevicesGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetEdgeDevices. + * json + */ + /** + * Sample code: Get Edge Device. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeDevices_List + +```java +/** + * Samples for EdgeDevices List. + */ +public final class EdgeDevicesListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListEdgeDevices. + * json + */ + /** + * Sample code: List Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeDevices_Validate + +```java +import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; +import java.util.Arrays; + +/** + * Samples for EdgeDevices Validate. + */ +public final class EdgeDevicesValidateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ValidateEdgeDevices.json + */ + /** + * Sample code: Validate Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", + new ValidateRequest().withEdgeDeviceIds(Arrays.asList( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/edgeDevices/default", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/edgeDevices/default")) + .withAdditionalInfo("test"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_Create + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for Extensions Create. + */ +public final class ExtensionsCreateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutExtension.json + */ + /** + * Sample code: Create Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + manager.extensions() + .define("MicrosoftMonitoringAgent") + .withExistingArcSetting("test-rg", "myCluster", "default") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withEnableAutomaticUpgrade(false) + .create(); + } +} +``` + +### Extensions_Delete + +```java +/** + * Samples for Extensions Delete. + */ +public final class ExtensionsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteExtension. + * json + */ + /** + * Sample code: Delete Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions() + .delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_Get + +```java +/** + * Samples for Extensions Get. + */ +public final class ExtensionsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetExtension.json + */ + /** + * Sample code: Get ArcSettings Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", + com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_ListByArcSetting + +```java +/** + * Samples for Extensions ListByArcSetting. + */ +public final class ExtensionsListByArcSettingSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + listExtensionsUnderArcSettingResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions().listByArcSetting("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; +import java.io.IOException; + +/** + * Samples for Extensions Update. + */ +public final class ExtensionsUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchExtension. + * json + */ + /** + * Sample code: Update Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + Extension resource = manager.extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withExtensionParameters(new ExtensionPatchParameters().withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(false) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON))) + .apply(); + } +} +``` + +### Extensions_Upgrade + +```java +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; + +/** + * Samples for Extensions Upgrade. + */ +public final class ExtensionsUpgradeSamples { + /* + * x-ms-original-file: + * 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. + */ + 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); + } +} +``` + +### 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 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(); + } +} +``` + +### GalleryImagesOperation_Delete + +```java +/** + * 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); + } +} +``` + +### GalleryImagesOperation_GetByResourceGroup + +```java +/** + * 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); + } +} +``` + +### GalleryImagesOperation_List + +```java +/** + * 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); + } +} +``` + +### GalleryImagesOperation_ListByResourceGroup + +```java +/** + * 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); + } +} +``` + +### GalleryImagesOperation_Update + +```java +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; + } +} +``` + +### GuestAgent_Create + +```java +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); + } +} +``` + +### GuestAgent_Delete + +```java +/** + * 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); + } +} +``` + +### GuestAgent_Get + +```java +/** + * 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); + } +} +``` + +### GuestAgentsOperation_List + +```java +/** + * 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); + } +} +``` + +### HybridIdentityMetadata_Get + +```java +/** + * 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); + } +} +``` + +### HybridIdentityMetadata_List + +```java +/** + * 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); + } +} +``` + +### LogicalNetworksOperation_CreateOrUpdate + +```java +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(); + } +} +``` + +### LogicalNetworksOperation_Delete + +```java +/** + * 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); + } +} +``` + +### LogicalNetworksOperation_GetByResourceGroup + +```java +/** + * 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); + } +} +``` + +### LogicalNetworksOperation_List + +```java +/** + * 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); + } +} +``` + +### LogicalNetworksOperation_ListByResourceGroup + +```java +/** + * 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); + } +} +``` + +### 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); } } ``` -### LogicalNetworksOperation_CreateOrUpdate +### SecuritySettings_CreateOrUpdate ```java -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; -/** Samples for LogicalNetworksOperation CreateOrUpdate. */ -public final class LogicalNetworksOperationCreateOrUpdateSamples { +/** + * Samples for SecuritySettings CreateOrUpdate. + */ +public final class SecuritySettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutLogicalNetwork.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutSecuritySettings.json */ /** - * Sample code: PutLogicalNetwork. - * + * Sample code: Create Security Settings. + * * @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)) + public static void createSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.securitySettings() + .define("default") + .withExistingCluster("test-rg", "myCluster") + .withSecuredCoreComplianceAssignment(ComplianceAssignmentType.AUDIT) .create(); } } ``` -### LogicalNetworksOperation_Delete +### SecuritySettings_Delete ```java -/** Samples for LogicalNetworksOperation Delete. */ -public final class LogicalNetworksOperationDeleteSamples { +/** + * Samples for SecuritySettings Delete. + */ +public final class SecuritySettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteLogicalNetwork.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteSecuritySettings.json */ /** - * Sample code: DeleteLogicalNetwork. - * + * Sample code: Delete Security Settings. + * * @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); + public static void deleteSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.securitySettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` -### LogicalNetworksOperation_GetByResourceGroup +### SecuritySettings_Get ```java -/** Samples for LogicalNetworksOperation GetByResourceGroup. */ -public final class LogicalNetworksOperationGetByResourceGroupSamples { +/** + * Samples for SecuritySettings Get. + */ +public final class SecuritySettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetLogicalNetwork.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetSecuritySettings.json */ /** - * Sample code: GetLogicalNetwork. - * + * Sample code: Get Security Settings. + * * @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); + public static void getSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.securitySettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` -### LogicalNetworksOperation_List +### SecuritySettings_ListByClusters ```java -/** Samples for LogicalNetworksOperation List. */ -public final class LogicalNetworksOperationListSamples { +/** + * Samples for SecuritySettings ListByClusters. + */ +public final class SecuritySettingsListByClustersSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkBySubscription.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListSecuritySettingsByCluster.json */ /** - * Sample code: ListLogicalNetworkBySubscription. - * + * Sample code: List Security Settings. + * * @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); + public static void listSecuritySettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.securitySettings().listByClusters("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### LogicalNetworksOperation_ListByResourceGroup +### Skus_Get ```java -/** Samples for LogicalNetworksOperation ListByResourceGroup. */ -public final class LogicalNetworksOperationListByResourceGroupSamples { +/** + * Samples for Skus Get. + */ +public final class SkusGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkByResourceGroup.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetSku.json */ /** - * Sample code: ListLogicalNetworkByResourceGroup. - * + * Sample code: Get Sku. + * * @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); + 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); } } ``` -### LogicalNetworksOperation_Update +### Skus_ListByOffer ```java -import com.azure.resourcemanager.azurestackhci.models.LogicalNetworks; -import java.util.HashMap; -import java.util.Map; - -/** Samples for LogicalNetworksOperation Update. */ -public final class LogicalNetworksOperationUpdateSamples { +/** + * Samples for Skus ListByOffer. + */ +public final class SkusListByOfferSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateLogicalNetwork.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListSkusByOffer. + * json */ /** - * Sample code: UpdateLogicalNetwork. - * + * Sample code: List SKU resources by offer for the HCI Cluster. + * * @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; + 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); } } ``` -### MarketplaceGalleryImagesOperation_CreateOrUpdate +### StorageContainersOperation_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 { +/** + * Samples for StorageContainersOperation CreateOrUpdate. + */ +public final class StorageContainersOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutMarketplaceGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutStorageContainer.json */ /** - * Sample code: PutMarketplaceGalleryImage. - * + * Sample code: PutStorageContainer. + * * @param manager Entry point to AzureStackHciManager. */ - public static void putMarketplaceGalleryImage( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager - .marketplaceGalleryImagesOperations() - .define("test-marketplace-gallery-image") + 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)) - .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")) + .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(); } } ``` -### MarketplaceGalleryImagesOperation_Delete +### StorageContainersOperation_Delete ```java -/** Samples for MarketplaceGalleryImagesOperation Delete. */ -public final class MarketplaceGalleryImagesOperationDeleteSamples { +/** + * Samples for StorageContainersOperation Delete. + */ +public final class StorageContainersOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteMarketplaceGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteStorageContainer.json */ /** - * Sample code: DeleteMarketplaceGalleryImage. - * + * Sample code: DeleteStorageContainer. + * * @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); + public static void deleteStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().delete("test-rg", "Default_Container", com.azure.core.util.Context.NONE); } } ``` -### MarketplaceGalleryImagesOperation_GetByResourceGroup +### StorageContainersOperation_GetByResourceGroup ```java -/** Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. */ -public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { +/** + * Samples for StorageContainersOperation GetByResourceGroup. + */ +public final class StorageContainersOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetMarketplaceGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetStorageContainer.json */ /** - * Sample code: GetMarketplaceGalleryImage. - * + * Sample code: GetStorageContainer. + * * @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); + public static void getStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE); } } ``` -### MarketplaceGalleryImagesOperation_List +### StorageContainersOperation_List ```java -/** Samples for MarketplaceGalleryImagesOperation List. */ -public final class MarketplaceGalleryImagesOperationListSamples { +/** + * Samples for StorageContainersOperation List. + */ +public final class StorageContainersOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageBySubscription.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListStorageContainerBySubscription.json */ /** - * Sample code: ListMarketplaceGalleryImageBySubscription. - * + * Sample code: ListStorageContainerBySubscription. + * * @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); + public static void + listStorageContainerBySubscription(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().list(com.azure.core.util.Context.NONE); } } ``` -### MarketplaceGalleryImagesOperation_ListByResourceGroup +### StorageContainersOperation_ListByResourceGroup ```java -/** Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. */ -public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { +/** + * Samples for StorageContainersOperation ListByResourceGroup. + */ +public final class StorageContainersOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageByResourceGroup.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListStorageContainerByResourceGroup.json */ /** - * Sample code: ListMarketplaceGalleryImageByResourceGroup. - * + * Sample code: ListStorageContainerByResourceGroup. + * * @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); + public static void + listStorageContainerByResourceGroup(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storageContainersOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` -### MarketplaceGalleryImagesOperation_Update +### StorageContainersOperation_Update ```java -import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImages; +import com.azure.resourcemanager.azurestackhci.models.StorageContainers; import java.util.HashMap; import java.util.Map; -/** Samples for MarketplaceGalleryImagesOperation Update. */ -public final class MarketplaceGalleryImagesOperationUpdateSamples { +/** + * Samples for StorageContainersOperation Update. + */ +public final class StorageContainersOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateMarketplaceGalleryImage.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * UpdateStorageContainer.json */ /** - * Sample code: UpdateMarketplaceGalleryImage. - * + * Sample code: UpdateStorageContainer. + * * @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(); + 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(); } @@ -717,338 +2509,373 @@ public final class MarketplaceGalleryImagesOperationUpdateSamples { } ``` -### NetworkInterfacesOperation_CreateOrUpdate +### UpdateRuns_Delete ```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 { +/** + * Samples for UpdateRuns Delete. + */ +public final class UpdateRunsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutNetworkInterface.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdateRuns. + * json */ /** - * Sample code: PutNetworkInterface. - * + * Sample code: Delete an Update. + * * @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(); + 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); } } ``` -### NetworkInterfacesOperation_Delete +### UpdateRuns_Get ```java -/** Samples for NetworkInterfacesOperation Delete. */ -public final class NetworkInterfacesOperationDeleteSamples { +/** + * Samples for UpdateRuns Get. + */ +public final class UpdateRunsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteNetworkInterface.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdateRuns. + * json */ /** - * Sample code: DeleteNetworkInterface. - * + * Sample code: Get Update runs under cluster resource. + * * @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); + 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); } } ``` -### NetworkInterfacesOperation_GetByResourceGroup +### UpdateRuns_List ```java -/** Samples for NetworkInterfacesOperation GetByResourceGroup. */ -public final class NetworkInterfacesOperationGetByResourceGroupSamples { +/** + * Samples for UpdateRuns List. + */ +public final class UpdateRunsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetNetworkInterface.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdateRuns. + * json */ /** - * Sample code: GetNetworkInterface. - * + * Sample code: List Update runs under cluster resource. + * * @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); + 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); } } ``` -### NetworkInterfacesOperation_List +### UpdateRuns_Put ```java -/** Samples for NetworkInterfacesOperation List. */ -public final class NetworkInterfacesOperationListSamples { +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/preview/2023-09-01-preview/examples/ListNetworkInterfaceBySubscription.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdateRuns. + * json */ /** - * Sample code: ListNetworkInterfaceBySubscription. - * + * Sample code: Get Update runs under cluster resource. + * * @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); + 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(); } } ``` -### NetworkInterfacesOperation_ListByResourceGroup +### UpdateSummariesOperation_Delete ```java -/** Samples for NetworkInterfacesOperation ListByResourceGroup. */ -public final class NetworkInterfacesOperationListByResourceGroupSamples { +/** + * Samples for UpdateSummariesOperation Delete. + */ +public final class UpdateSummariesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListNetworkInterfaceByResourceGroup.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteUpdateSummaries.json */ /** - * Sample code: ListNetworkInterfaceByResourceGroup. - * + * Sample code: Delete an Update. + * * @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); + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); } } ``` -### NetworkInterfacesOperation_Update +### UpdateSummariesOperation_Get ```java -import com.azure.resourcemanager.azurestackhci.models.NetworkInterfaces; -import java.util.HashMap; -import java.util.Map; - -/** Samples for NetworkInterfacesOperation Update. */ -public final class NetworkInterfacesOperationUpdateSamples { +/** + * Samples for UpdateSummariesOperation Get. + */ +public final class UpdateSummariesOperationGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateNetworkInterface.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetUpdateSummaries.json */ /** - * Sample code: UpdateNetworkInterface. - * + * Sample code: Get Update summaries under cluster resource. + * * @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; + public static void + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### UpdateSummariesOperation_List ```java -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** + * Samples for UpdateSummariesOperation List. + */ +public final class UpdateSummariesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListOperations.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListUpdateSummaries.json */ /** - * Sample code: ListOperations. - * + * Sample code: Get Update summaries under cluster resource. + * * @param manager Entry point to AzureStackHciManager. */ - public static void listOperations(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void + getUpdateSummariesUnderClusterResource(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); } } ``` -### StorageContainersOperation_CreateOrUpdate +### UpdateSummariesOperation_Put ```java -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; - -/** Samples for StorageContainersOperation CreateOrUpdate. */ -public final class StorageContainersOperationCreateOrUpdateSamples { +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/preview/2023-09-01-preview/examples/PutStorageContainer.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutUpdateSummaries.json */ /** - * Sample code: PutStorageContainer. - * + * Sample code: Put Update summaries under cluster resource. + * * @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(); + 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); } } ``` -### StorageContainersOperation_Delete +### Updates_Delete ```java -/** Samples for StorageContainersOperation Delete. */ -public final class StorageContainersOperationDeleteSamples { +/** + * Samples for Updates Delete. + */ +public final class UpdatesDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteStorageContainer.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdates. + * json */ /** - * Sample code: DeleteStorageContainer. - * + * Sample code: Delete an Update. + * * @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); + 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); } } ``` -### StorageContainersOperation_GetByResourceGroup +### Updates_Get ```java -/** Samples for StorageContainersOperation GetByResourceGroup. */ -public final class StorageContainersOperationGetByResourceGroupSamples { +/** + * Samples for Updates Get. + */ +public final class UpdatesGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetStorageContainer.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdates.json */ /** - * Sample code: GetStorageContainer. - * + * Sample code: Get a specific update. + * * @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); + 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); } } ``` -### StorageContainersOperation_List +### Updates_List ```java -/** Samples for StorageContainersOperation List. */ -public final class StorageContainersOperationListSamples { +/** + * Samples for Updates List. + */ +public final class UpdatesListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerBySubscription.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdates.json */ /** - * Sample code: ListStorageContainerBySubscription. - * + * Sample code: List available updates. + * * @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); + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); } } ``` -### StorageContainersOperation_ListByResourceGroup +### Updates_Post ```java -/** Samples for StorageContainersOperation ListByResourceGroup. */ -public final class StorageContainersOperationListByResourceGroupSamples { +/** + * Samples for Updates Post. + */ +public final class UpdatesPostSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerByResourceGroup.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PostUpdates.json */ /** - * Sample code: ListStorageContainerByResourceGroup. - * + * Sample code: List available updates. + * * @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); + 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); } } ``` -### StorageContainersOperation_Update +### Updates_Put ```java -import com.azure.resourcemanager.azurestackhci.models.StorageContainers; -import java.util.HashMap; -import java.util.Map; +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 StorageContainersOperation Update. */ -public final class StorageContainersOperationUpdateSamples { +/** + * Samples for Updates Put. + */ +public final class UpdatesPutSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateStorageContainer.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdates.json */ /** - * Sample code: UpdateStorageContainer. - * + * Sample code: Put a specific update. + * * @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; + 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(); } } ``` @@ -1059,27 +2886,28 @@ public final class StorageContainersOperationUpdateSamples { import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for VirtualHardDisksOperation CreateOrUpdate. */ +/** + * Samples for VirtualHardDisksOperation CreateOrUpdate. + */ public final class VirtualHardDisksOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualHardDisk.json + * 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() + 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)) + .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(); } @@ -1089,14 +2917,18 @@ public final class VirtualHardDisksOperationCreateOrUpdateSamples { ### VirtualHardDisksOperation_Delete ```java -/** Samples for VirtualHardDisksOperation Delete. */ +/** + * Samples for VirtualHardDisksOperation Delete. + */ public final class VirtualHardDisksOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualHardDisk.json + * 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) { @@ -1108,19 +2940,22 @@ public final class VirtualHardDisksOperationDeleteSamples { ### VirtualHardDisksOperation_GetByResourceGroup ```java -/** Samples for VirtualHardDisksOperation GetByResourceGroup. */ +/** + * Samples for VirtualHardDisksOperation GetByResourceGroup. + */ public final class VirtualHardDisksOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualHardDisk.json + * 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() + manager.virtualHardDisksOperations() .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE); } } @@ -1129,18 +2964,22 @@ public final class VirtualHardDisksOperationGetByResourceGroupSamples { ### VirtualHardDisksOperation_List ```java -/** Samples for VirtualHardDisksOperation List. */ +/** + * Samples for VirtualHardDisksOperation List. + */ public final class VirtualHardDisksOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskBySubscription.json + * 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) { + public static void + listVirtualHardDiskBySubscription(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager.virtualHardDisksOperations().list(com.azure.core.util.Context.NONE); } } @@ -1149,18 +2988,22 @@ public final class VirtualHardDisksOperationListSamples { ### VirtualHardDisksOperation_ListByResourceGroup ```java -/** Samples for VirtualHardDisksOperation ListByResourceGroup. */ +/** + * Samples for VirtualHardDisksOperation ListByResourceGroup. + */ public final class VirtualHardDisksOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + * 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) { + public static void + listVirtualHardDiskByResourceGroup(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager.virtualHardDisksOperations().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } @@ -1173,22 +3016,24 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisks; import java.util.HashMap; import java.util.Map; -/** Samples for VirtualHardDisksOperation Update. */ +/** + * Samples for VirtualHardDisksOperation Update. + */ public final class VirtualHardDisksOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualHardDisk.json + * 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(); + VirtualHardDisks resource = manager.virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } @@ -1225,207 +3070,157 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceProp import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; import java.util.Arrays; -/** Samples for VirtualMachineInstances CreateOrUpdate. */ +/** + * Samples for VirtualMachineInstances CreateOrUpdate. + */ public final class VirtualMachineInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithGalleryImage.json + * 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() + 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)) + 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")))) + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) .withOsProfile( - new VirtualMachineInstancePropertiesOsProfile() - .withAdminPassword("fakeTokenPlaceholder") + 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")), + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference(new VirtualMachineInstancePropertiesStorageProfileImageReference().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithOsDisk.json + * 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() + 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)) + 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")), + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withOsDisk(new VirtualMachineInstancePropertiesStorageProfileOsDisk().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json + * 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() + 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)) + 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")))) + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) .withOsProfile( - new VirtualMachineInstancePropertiesOsProfile() - .withAdminPassword("fakeTokenPlaceholder") + 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")), + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference(new VirtualMachineInstancePropertiesStorageProfileImageReference().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithVMConfigAgent.json + * 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() + 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)) + 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")), + .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); } } @@ -1434,19 +3229,22 @@ public final class VirtualMachineInstancesCreateOrUpdateSamples { ### VirtualMachineInstances_Delete ```java -/** Samples for VirtualMachineInstances Delete. */ +/** + * Samples for VirtualMachineInstances Delete. + */ public final class VirtualMachineInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualMachineInstance.json + * 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() + manager.virtualMachineInstances() .delete( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", com.azure.core.util.Context.NONE); @@ -1457,19 +3255,22 @@ public final class VirtualMachineInstancesDeleteSamples { ### VirtualMachineInstances_Get ```java -/** Samples for VirtualMachineInstances Get. */ +/** + * Samples for VirtualMachineInstances Get. + */ public final class VirtualMachineInstancesGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualMachineInstance.json + * 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() + manager.virtualMachineInstances() .getWithResponse( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", com.azure.core.util.Context.NONE); @@ -1480,20 +3281,23 @@ public final class VirtualMachineInstancesGetSamples { ### VirtualMachineInstances_List ```java -/** Samples for VirtualMachineInstances List. */ +/** + * Samples for VirtualMachineInstances List. + */ public final class VirtualMachineInstancesListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualMachineInstances.json + * 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() + 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); @@ -1504,19 +3308,22 @@ public final class VirtualMachineInstancesListSamples { ### VirtualMachineInstances_Restart ```java -/** Samples for VirtualMachineInstances Restart. */ +/** + * Samples for VirtualMachineInstances Restart. + */ public final class VirtualMachineInstancesRestartSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/RestartVirtualMachineInstance.json + * 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() + 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); @@ -1527,19 +3334,22 @@ public final class VirtualMachineInstancesRestartSamples { ### VirtualMachineInstances_Start ```java -/** Samples for VirtualMachineInstances Start. */ +/** + * Samples for VirtualMachineInstances Start. + */ public final class VirtualMachineInstancesStartSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StartVirtualMachineInstance.json + * 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() + 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); @@ -1550,19 +3360,22 @@ public final class VirtualMachineInstancesStartSamples { ### VirtualMachineInstances_Stop ```java -/** Samples for VirtualMachineInstances Stop. */ +/** + * Samples for VirtualMachineInstances Stop. + */ public final class VirtualMachineInstancesStopSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StopVirtualMachineInstance.json + * 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() + 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); @@ -1579,32 +3392,28 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpda import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; import java.util.Arrays; -/** Samples for VirtualMachineInstances Update. */ +/** + * Samples for VirtualMachineInstances Update. + */ public final class VirtualMachineInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualMachineInstance.json + * 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() + 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"))))), + 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 88e0830389aa..9d2fba815469 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-preview-2023-09. + 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 @@ -48,6 +48,11 @@ true + + com.azure + azure-json + 1.1.0 + com.azure azure-core @@ -88,8 +93,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index f1af2d977eb2..1fade63d28d5 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,8 +11,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -24,7 +24,12 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; +import com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsImpl; import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; +import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.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; @@ -32,10 +37,22 @@ 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.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; @@ -43,8 +60,15 @@ 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.VirtualHardDisksOperations; import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstances; import java.time.Duration; @@ -54,11 +78,22 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to AzureStackHciManager. Azure Stack HCI management service. */ +/** + * Entry point to AzureStackHciManager. + * Azure Stack HCI management service. + */ public final class AzureStackHciManager { - private GalleryImagesOperations galleryImagesOperations; + private ArcSettings arcSettings; - private Operations operations; + private Clusters clusters; + + private DeploymentSettings deploymentSettings; + + private EdgeDevices edgeDevices; + + private Extensions extensions; + + private GalleryImagesOperations galleryImagesOperations; private LogicalNetworksOperations logicalNetworksOperations; @@ -66,8 +101,24 @@ public final class AzureStackHciManager { private NetworkInterfacesOperations networkInterfacesOperations; + private Offers offers; + + private Operations operations; + + private Publishers publishers; + + private SecuritySettings securitySettings; + + private Skus skus; + private StorageContainersOperations storageContainersOperations; + private UpdateRuns updateRuns; + + private UpdateSummariesOperations updateSummariesOperations; + + private Updates updates; + private VirtualHardDisksOperations virtualHardDisksOperations; private VirtualMachineInstances virtualMachineInstances; @@ -83,18 +134,16 @@ public final class AzureStackHciManager { 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) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new AzureStackHciClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * 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. @@ -107,7 +156,7 @@ public static AzureStackHciManager authenticate(TokenCredential credential, Azur /** * 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. @@ -120,14 +169,16 @@ public static AzureStackHciManager authenticate(HttpPipeline httpPipeline, Azure /** * 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(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -199,8 +250,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -217,8 +268,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -238,15 +289,13 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -271,154 +320,289 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new AzureStackHciManager(httpPipeline, profile, defaultPollInterval); } } /** - * Gets the resource collection API of GalleryImagesOperations. It manages GalleryImages. - * - * @return Resource collection API of GalleryImagesOperations. + * Gets the resource collection API of ArcSettings. It manages ArcSetting. + * + * @return Resource collection API of ArcSettings. */ - public GalleryImagesOperations galleryImagesOperations() { - if (this.galleryImagesOperations == null) { - this.galleryImagesOperations = - new GalleryImagesOperationsImpl(clientObject.getGalleryImagesOperations(), this); + public ArcSettings arcSettings() { + if (this.arcSettings == null) { + this.arcSettings = new ArcSettingsImpl(clientObject.getArcSettings(), this); } - return galleryImagesOperations; + return arcSettings; } /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. + * Gets the resource collection API of Clusters. It manages Cluster. + * + * @return Resource collection API of Clusters. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return operations; + return clusters; + } + + /** + * Gets the resource collection API of DeploymentSettings. It manages DeploymentSetting. + * + * @return Resource collection API of DeploymentSettings. + */ + public DeploymentSettings deploymentSettings() { + if (this.deploymentSettings == null) { + this.deploymentSettings = new DeploymentSettingsImpl(clientObject.getDeploymentSettings(), this); + } + return deploymentSettings; + } + + /** + * Gets the resource collection API of EdgeDevices. It manages EdgeDevice. + * + * @return Resource collection API of EdgeDevices. + */ + public EdgeDevices edgeDevices() { + if (this.edgeDevices == null) { + this.edgeDevices = new EdgeDevicesImpl(clientObject.getEdgeDevices(), this); + } + return edgeDevices; + } + + /** + * Gets the resource collection API of Extensions. It manages Extension. + * + * @return Resource collection API of Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + } + 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); + 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); + 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); + this.networkInterfacesOperations + = new NetworkInterfacesOperationsImpl(clientObject.getNetworkInterfacesOperations(), this); } return networkInterfacesOperations; } + /** + * Gets the resource collection API of Offers. + * + * @return Resource collection API of Offers. + */ + public Offers offers() { + if (this.offers == null) { + this.offers = new OffersImpl(clientObject.getOffers(), this); + } + return offers; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Publishers. + * + * @return Resource collection API of Publishers. + */ + public Publishers publishers() { + if (this.publishers == null) { + this.publishers = new PublishersImpl(clientObject.getPublishers(), this); + } + return publishers; + } + + /** + * Gets the resource collection API of SecuritySettings. It manages SecuritySetting. + * + * @return Resource collection API of SecuritySettings. + */ + public SecuritySettings securitySettings() { + if (this.securitySettings == null) { + this.securitySettings = new SecuritySettingsImpl(clientObject.getSecuritySettings(), this); + } + return securitySettings; + } + + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + 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); + this.storageContainersOperations + = new StorageContainersOperationsImpl(clientObject.getStorageContainersOperations(), this); } return storageContainersOperations; } + /** + * Gets the resource collection API of UpdateRuns. It manages UpdateRun. + * + * @return Resource collection API of UpdateRuns. + */ + public UpdateRuns updateRuns() { + if (this.updateRuns == null) { + this.updateRuns = new UpdateRunsImpl(clientObject.getUpdateRuns(), this); + } + return updateRuns; + } + + /** + * Gets the resource collection API of UpdateSummariesOperations. + * + * @return Resource collection API of UpdateSummariesOperations. + */ + public UpdateSummariesOperations updateSummariesOperations() { + if (this.updateSummariesOperations == null) { + this.updateSummariesOperations + = new UpdateSummariesOperationsImpl(clientObject.getUpdateSummariesOperations(), this); + } + return updateSummariesOperations; + } + + /** + * Gets the resource collection API of Updates. It manages HciUpdate. + * + * @return Resource collection API of Updates. + */ + public Updates updates() { + if (this.updates == null) { + this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + } + 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); + 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); + 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); + 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() { @@ -430,7 +614,7 @@ public GuestAgents guestAgents() { /** * Gets the resource collection API of GuestAgentsOperations. - * + * * @return Resource collection API of GuestAgentsOperations. */ public GuestAgentsOperations guestAgentsOperations() { @@ -443,7 +627,7 @@ public GuestAgentsOperations guestAgentsOperations() { /** * Gets wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. - * + * * @return Wrapped service client AzureStackHciClient. */ public AzureStackHciClient serviceClient() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java new file mode 100644 index 000000000000..b1ea2a3c20a3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -0,0 +1,382 @@ +// Copyright (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.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; + +/** + * An instance of this class provides access to all the operations defined in ArcSettingsClient. + */ +public interface ArcSettingsClient { + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingInner arcSetting, Context context); + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner create(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingInner arcSetting); + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingsPatch arcSetting, Context context); + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner update(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingsPatch arcSetting); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generatePasswordWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response consentAndInstallDefaultExtensionsWithResponse(String resourceGroupName, + String clusterName, String arcSettingName, Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName, + String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInitializeDisableProcess(String resourceGroupName, String clusterName, + String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInitializeDisableProcess(String resourceGroupName, String clusterName, + String arcSettingName, Context context); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, Context context); +} 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 33641ac01498..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 @@ -7,116 +7,202 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AzureStackHciClient class. */ +/** + * The interface for AzureStackHciClient class. + */ public interface AzureStackHciClient { /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** - * Gets the GalleryImagesOperationsClient object to access its operations. - * - * @return the GalleryImagesOperationsClient object. + * Gets the ArcSettingsClient object to access its operations. + * + * @return the ArcSettingsClient object. */ - GalleryImagesOperationsClient getGalleryImagesOperations(); + ArcSettingsClient getArcSettings(); /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. */ - OperationsClient getOperations(); + ClustersClient getClusters(); + + /** + * Gets the DeploymentSettingsClient object to access its operations. + * + * @return the DeploymentSettingsClient object. + */ + DeploymentSettingsClient getDeploymentSettings(); + + /** + * Gets the EdgeDevicesClient object to access its operations. + * + * @return the EdgeDevicesClient object. + */ + EdgeDevicesClient getEdgeDevices(); + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + 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. + * + * @return the OffersClient object. + */ + OffersClient getOffers(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + PublishersClient getPublishers(); + + /** + * Gets the SecuritySettingsClient object to access its operations. + * + * @return the SecuritySettingsClient object. + */ + SecuritySettingsClient getSecuritySettings(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + /** * Gets the StorageContainersOperationsClient object to access its operations. - * + * * @return the StorageContainersOperationsClient object. */ StorageContainersOperationsClient getStorageContainersOperations(); + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + UpdateRunsClient getUpdateRuns(); + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + UpdateSummariesOperationsClient getUpdateSummariesOperations(); + + /** + * Gets the UpdatesClient object to access its operations. + * + * @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 new file mode 100644 index 000000000000..98a1661602d8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; + +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ +public interface ClustersClient { + /** + * List all HCI clusters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all HCI clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all HCI clusters in a resource group. + * + * @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 clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String clusterName, ClusterInner cluster, + Context context); + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 create(String resourceGroupName, String clusterName, ClusterInner cluster); + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String clusterName, ClusterPatch cluster, + Context context); + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 update(String resourceGroupName, String clusterName, ClusterPatch cluster); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefit(String resourceGroupName, + String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefit(String resourceGroupName, + String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/DeploymentSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/DeploymentSettingsClient.java new file mode 100644 index 000000000000..3ab4e14034eb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/DeploymentSettingsClient.java @@ -0,0 +1,200 @@ +// Copyright (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.DeploymentSettingInner; + +/** + * An instance of this class provides access to all the operations defined in DeploymentSettingsClient. + */ +public interface DeploymentSettingsClient { + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusters(String resourceGroupName, String clusterName); + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DeploymentSetting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context); + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DeploymentSetting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentSettingInner get(String resourceGroupName, String clusterName, String deploymentSettingsName); + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @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 the {@link SyncPoller} for polling of edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentSettingInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String deploymentSettingsName, DeploymentSettingInner resource); + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @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 the {@link SyncPoller} for polling of edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentSettingInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String deploymentSettingsName, DeploymentSettingInner resource, Context context); + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentSettingInner createOrUpdate(String resourceGroupName, String clusterName, String deploymentSettingsName, + DeploymentSettingInner resource); + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentSettingInner createOrUpdate(String resourceGroupName, String clusterName, String deploymentSettingsName, + DeploymentSettingInner resource, Context context); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String deploymentSettingsName); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String deploymentSettingsName); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String deploymentSettingsName, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/EdgeDevicesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/EdgeDevicesClient.java new file mode 100644 index 000000000000..f7d9780db850 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/EdgeDevicesClient.java @@ -0,0 +1,247 @@ +// Copyright (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.EdgeDeviceInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; + +/** + * An instance of this class provides access to all the operations defined in EdgeDevicesClient. + */ +public interface EdgeDevicesClient { + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 EdgeDevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, String edgeDeviceName, Context context); + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 EdgeDevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeDeviceInner get(String resourceUri, String edgeDeviceName); + + /** + * Create 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 the {@link SyncPoller} for polling of edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeDeviceInner> beginCreateOrUpdate(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource); + + /** + * Create 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 the {@link SyncPoller} for polling of edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeDeviceInner> beginCreateOrUpdate(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource, Context context); + + /** + * Create 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeDeviceInner createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource); + + /** + * Create 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeDeviceInner createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource, + Context context); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, String edgeDeviceName); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, String edgeDeviceName, Context context); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String edgeDeviceName); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String edgeDeviceName, Context context); + + /** + * 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 the {@link SyncPoller} for polling of an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateResponseInner> beginValidate(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest); + + /** + * 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 the {@link SyncPoller} for polling of an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateResponseInner> beginValidate(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest, Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateResponseInner validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateResponseInner validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, + Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java new file mode 100644 index 000000000000..9c174e73450b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java @@ -0,0 +1,354 @@ +// Copyright (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.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; + +/** + * An instance of this class provides access to all the operations defined in ExtensionsClient. + */ +public interface ExtensionsClient { + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginCreate(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionInner extension); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginCreate(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionInner extension, Context context); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner create(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionInner extension); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner create(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionInner extension, Context context); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginUpdate(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionPatch extension); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginUpdate(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionPatch extension, Context context); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner update(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionPatch extension); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner update(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionPatch extension, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgrade(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgrade(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters, Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, 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 index 8ac30aa17d8c..f43755f24910 100644 --- 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 @@ -14,11 +14,13 @@ 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. */ +/** + * 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. @@ -28,12 +30,12 @@ public interface GalleryImagesOperationsClient { * @return a gallery image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String galleryImageName, Context context); + 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. @@ -47,26 +49,26 @@ Response getByResourceGroupWithResponse( /** * The operation to create or update a gallery image. Please note some properties can be set only during gallery * image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource definition. + * @param 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); + SyncPoller, GalleryImagesInner> beginCreateOrUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesInner galleryImages); /** * The operation to create or update a gallery image. Please note some properties can be set only during gallery * image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource definition. + * @param 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. @@ -74,32 +76,32 @@ SyncPoller, GalleryImagesInner> beginCreateOrUpda * @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); + SyncPoller, GalleryImagesInner> beginCreateOrUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesInner galleryImages, Context context); /** * The operation to create or update a gallery image. Please note some properties can be set only during gallery * image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource definition. + * @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); + GalleryImagesInner createOrUpdate(String resourceGroupName, String galleryImageName, + GalleryImagesInner galleryImages); /** * The operation to create or update a gallery image. Please note some properties can be set only during gallery * image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource definition. + * @param 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. @@ -107,12 +109,12 @@ GalleryImagesInner createOrUpdate( * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImagesInner createOrUpdate( - String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context); + 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. @@ -125,7 +127,7 @@ GalleryImagesInner createOrUpdate( /** * 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. @@ -139,7 +141,7 @@ GalleryImagesInner createOrUpdate( /** * 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. @@ -151,7 +153,7 @@ GalleryImagesInner createOrUpdate( /** * 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. @@ -164,25 +166,25 @@ GalleryImagesInner createOrUpdate( /** * The operation to update a gallery image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource patch definition. + * @param 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); + SyncPoller, GalleryImagesInner> beginUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages); /** * The operation to update a gallery image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource patch definition. + * @param 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. @@ -190,30 +192,30 @@ SyncPoller, GalleryImagesInner> beginUpdate( * @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); + SyncPoller, GalleryImagesInner> beginUpdate(String resourceGroupName, + String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context); /** * The operation to update a gallery image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource patch definition. + * @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); + GalleryImagesInner update(String resourceGroupName, String galleryImageName, + GalleryImagesUpdateRequest galleryImages); /** * The operation to update a gallery image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource patch definition. + * @param 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. @@ -221,13 +223,13 @@ GalleryImagesInner update( * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImagesInner update( - String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context); + 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. @@ -240,7 +242,7 @@ GalleryImagesInner update( /** * 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. @@ -254,7 +256,7 @@ GalleryImagesInner update( /** * 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}. @@ -265,7 +267,7 @@ GalleryImagesInner update( /** * 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. 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 index 22aeedc79f55..71fff973f731 100644 --- 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 @@ -12,15 +12,17 @@ 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. */ +/** + * 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. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -31,11 +33,11 @@ public interface GuestAgentsClient { /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -44,16 +46,16 @@ public interface GuestAgentsClient { * @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); + SyncPoller, GuestAgentInner> beginCreate(String resourceUri, GuestAgentInner body, + Context context); /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -64,11 +66,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -81,11 +83,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -97,11 +99,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -112,11 +114,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -127,11 +129,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -143,11 +145,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -157,11 +159,11 @@ SyncPoller, GuestAgentInner> beginCreate( /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. 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 index 6bda752073d4..85e748c6c412 100644 --- 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 @@ -10,15 +10,17 @@ 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. */ +/** + * 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. - * + * + * 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. + * 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. @@ -29,11 +31,11 @@ public interface GuestAgentsOperationsClient { /** * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given 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. + * 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. 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 index 8082f894a4d0..4ed15fa023b9 100644 --- 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 @@ -11,15 +11,17 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. + */ public interface HybridIdentityMetadatasClient { /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -31,11 +33,11 @@ public interface HybridIdentityMetadatasClient { /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -46,11 +48,11 @@ public interface HybridIdentityMetadatasClient { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. @@ -61,11 +63,11 @@ public interface HybridIdentityMetadatasClient { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. 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 index 5766077dab83..8a6626c2c5ef 100644 --- 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 @@ -14,11 +14,13 @@ 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. */ +/** + * 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. @@ -28,12 +30,12 @@ public interface LogicalNetworksOperationsClient { * @return the logical network resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String logicalNetworkName, Context context); + 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. @@ -47,26 +49,26 @@ Response getByResourceGroupWithResponse( /** * 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 logical network resource definition. + * @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); + 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 logical network resource definition. + * @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. @@ -74,32 +76,32 @@ SyncPoller, LogicalNetworksInner> beginCreateOr * @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); + 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 logical network resource definition. + * @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); + 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 logical network resource definition. + * @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. @@ -107,12 +109,12 @@ LogicalNetworksInner createOrUpdate( * @return the logical network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - LogicalNetworksInner createOrUpdate( - String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks, Context context); + 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. @@ -125,7 +127,7 @@ LogicalNetworksInner createOrUpdate( /** * 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. @@ -135,12 +137,12 @@ LogicalNetworksInner createOrUpdate( * @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); + 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. @@ -152,7 +154,7 @@ SyncPoller, Void> beginDelete( /** * 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. @@ -165,25 +167,25 @@ SyncPoller, Void> beginDelete( /** * 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 logical network resource patch definition. + * @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); + 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 logical network resource patch definition. + * @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. @@ -191,33 +193,30 @@ SyncPoller, LogicalNetworksInner> beginUpdate( * @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); + 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 logical network resource patch definition. + * @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); + 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 logical network resource patch definition. + * @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. @@ -225,16 +224,13 @@ LogicalNetworksInner update( * @return the logical network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - LogicalNetworksInner update( - String resourceGroupName, - String logicalNetworkName, - LogicalNetworksUpdateRequest logicalNetworks, - Context context); + 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. @@ -247,7 +243,7 @@ LogicalNetworksInner update( /** * 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. @@ -261,7 +257,7 @@ LogicalNetworksInner update( /** * 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}. @@ -272,7 +268,7 @@ LogicalNetworksInner update( /** * 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. 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 index b082967a0ae2..d3f1b3a576cf 100644 --- 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 @@ -20,7 +20,7 @@ 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. @@ -30,12 +30,12 @@ public interface MarketplaceGalleryImagesOperationsClient { * @return a marketplace gallery image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String marketplaceGalleryImageName, Context context); + 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. @@ -49,10 +49,10 @@ Response getByResourceGroupWithResponse( /** * The operation to create or update a marketplace gallery image. Please note some properties can be set only during * marketplace gallery image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param marketplaceGalleryImageName Name of the marketplace gallery image. - * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @param 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. @@ -60,17 +60,16 @@ Response getByResourceGroupWithResponse( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, + String resourceGroupName, String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages); /** * The operation to create or update a marketplace gallery image. Please note some properties can be set only during * marketplace gallery image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param marketplaceGalleryImageName Name of the marketplace gallery image. - * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @param 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. @@ -79,36 +78,32 @@ SyncPoller, MarketplaceGalleryImagesIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context); + 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 marketplace gallery image resource definition. + * @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 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 marketplace gallery image resource definition. + * @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. @@ -116,15 +111,12 @@ MarketplaceGalleryImagesInner createOrUpdate( * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - MarketplaceGalleryImagesInner createOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context); + 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. @@ -137,7 +129,7 @@ MarketplaceGalleryImagesInner createOrUpdate( /** * 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. @@ -147,12 +139,12 @@ MarketplaceGalleryImagesInner createOrUpdate( * @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); + 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. @@ -164,7 +156,7 @@ SyncPoller, Void> beginDelete( /** * 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. @@ -177,10 +169,10 @@ SyncPoller, Void> beginDelete( /** * 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 marketplace gallery image resource patch definition. + * @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. @@ -188,16 +180,15 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, + 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 marketplace gallery image resource patch definition. + * @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. @@ -206,34 +197,30 @@ SyncPoller, MarketplaceGalleryImagesIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, - Context context); + 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 marketplace gallery image resource patch definition. + * @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, + 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 marketplace gallery image resource patch definition. + * @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. @@ -241,16 +228,13 @@ MarketplaceGalleryImagesInner update( * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - MarketplaceGalleryImagesInner update( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, - Context context); + 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. @@ -263,7 +247,7 @@ MarketplaceGalleryImagesInner update( /** * 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. @@ -277,7 +261,7 @@ MarketplaceGalleryImagesInner update( /** * 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}. @@ -288,7 +272,7 @@ MarketplaceGalleryImagesInner update( /** * 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. 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 index e090bed11e54..f7e5d94c48b6 100644 --- 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 @@ -14,11 +14,13 @@ 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. */ +/** + * 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. @@ -28,12 +30,12 @@ public interface NetworkInterfacesOperationsClient { * @return a network interface along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String networkInterfaceName, Context context); + 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. @@ -47,26 +49,26 @@ Response getByResourceGroupWithResponse( /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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); + 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 network interface resource definition. + * @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. @@ -74,35 +76,32 @@ SyncPoller, NetworkInterfacesInner> beginCrea * @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); + 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 network interface resource definition. + * @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); + 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 network interface resource definition. + * @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. @@ -110,15 +109,12 @@ NetworkInterfacesInner createOrUpdate( * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfacesInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesInner networkInterfaces, - Context context); + 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. @@ -131,7 +127,7 @@ NetworkInterfacesInner createOrUpdate( /** * 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. @@ -141,12 +137,12 @@ NetworkInterfacesInner createOrUpdate( * @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); + 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. @@ -158,7 +154,7 @@ SyncPoller, Void> beginDelete( /** * 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. @@ -171,25 +167,25 @@ SyncPoller, Void> beginDelete( /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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); + 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 network interface resource patch definition. + * @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. @@ -197,33 +193,30 @@ SyncPoller, NetworkInterfacesInner> beginUpda * @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); + 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 network interface resource patch definition. + * @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); + 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 network interface resource patch definition. + * @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. @@ -231,16 +224,13 @@ NetworkInterfacesInner update( * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfacesInner update( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesUpdateRequest networkInterfaces, - Context context); + 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. @@ -253,7 +243,7 @@ NetworkInterfacesInner update( /** * 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. @@ -267,7 +257,7 @@ NetworkInterfacesInner update( /** * 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}. @@ -278,7 +268,7 @@ NetworkInterfacesInner update( /** * 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. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java new file mode 100644 index 000000000000..9e145741b219 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.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.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.OfferInner; + +/** + * An instance of this class provides access to all the operations defined in OffersClient. + */ +public interface OffersClient { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName, + String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, + Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java index fbbf0196b3ed..6feec3a3c889 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java @@ -6,33 +6,33 @@ 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.OperationInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); /** - * List all the supported operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List all available Microsoft.AzureStackHCI provider operations. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + OperationListResultInner list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java new file mode 100644 index 000000000000..fc00e8192d2e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.PublisherInner; + +/** + * An instance of this class provides access to all the operations defined in PublishersClient. + */ +public interface PublishersClient { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SecuritySettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SecuritySettingsClient.java new file mode 100644 index 000000000000..4892d4ba3fe3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SecuritySettingsClient.java @@ -0,0 +1,200 @@ +// Copyright (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.SecuritySettingInner; + +/** + * An instance of this class provides access to all the operations defined in SecuritySettingsClient. + */ +public interface SecuritySettingsClient { + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusters(String resourceGroupName, String clusterName); + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SecuritySetting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, + String securitySettingsName, Context context); + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SecuritySetting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecuritySettingInner get(String resourceGroupName, String clusterName, String securitySettingsName); + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @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 the {@link SyncPoller} for polling of security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecuritySettingInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String securitySettingsName, SecuritySettingInner resource); + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @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 the {@link SyncPoller} for polling of security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecuritySettingInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String securitySettingsName, SecuritySettingInner resource, Context context); + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecuritySettingInner createOrUpdate(String resourceGroupName, String clusterName, String securitySettingsName, + SecuritySettingInner resource); + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecuritySettingInner createOrUpdate(String resourceGroupName, String clusterName, String securitySettingsName, + SecuritySettingInner resource, Context context); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String securitySettingsName); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String securitySettingsName, Context context); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String securitySettingsName); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String securitySettingsName, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java new file mode 100644 index 000000000000..7cf73f5cbfe9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.SkuInner; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public interface SkusClient { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String skuName, String expand, Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuInner get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} 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 index 3f8556812857..3726f688314b 100644 --- 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 @@ -14,11 +14,13 @@ 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. */ +/** + * 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. @@ -28,12 +30,12 @@ public interface StorageContainersOperationsClient { * @return a storage container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String storageContainerName, Context context); + 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. @@ -47,26 +49,26 @@ Response getByResourceGroupWithResponse( /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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); + SyncPoller, StorageContainersInner> beginCreateOrUpdate(String resourceGroupName, + String storageContainerName, StorageContainersInner storageContainers); /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -74,35 +76,32 @@ SyncPoller, StorageContainersInner> beginCrea * @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); + SyncPoller, StorageContainersInner> beginCreateOrUpdate(String resourceGroupName, + String storageContainerName, StorageContainersInner storageContainers, Context context); /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @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); + StorageContainersInner createOrUpdate(String resourceGroupName, String storageContainerName, + StorageContainersInner storageContainers); /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -110,15 +109,12 @@ StorageContainersInner createOrUpdate( * @return the storage container resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageContainersInner createOrUpdate( - String resourceGroupName, - String storageContainerName, - StorageContainersInner storageContainers, - Context context); + 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. @@ -131,7 +127,7 @@ StorageContainersInner createOrUpdate( /** * 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. @@ -141,12 +137,12 @@ StorageContainersInner createOrUpdate( * @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); + 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. @@ -158,7 +154,7 @@ SyncPoller, Void> beginDelete( /** * 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. @@ -171,25 +167,25 @@ SyncPoller, Void> beginDelete( /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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); + SyncPoller, StorageContainersInner> beginUpdate(String resourceGroupName, + String storageContainerName, StorageContainersUpdateRequest storageContainers); /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -197,33 +193,30 @@ SyncPoller, StorageContainersInner> beginUpda * @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); + SyncPoller, StorageContainersInner> beginUpdate(String resourceGroupName, + String storageContainerName, StorageContainersUpdateRequest storageContainers, Context context); /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @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); + StorageContainersInner update(String resourceGroupName, String storageContainerName, + StorageContainersUpdateRequest storageContainers); /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -231,16 +224,13 @@ StorageContainersInner update( * @return the storage container resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageContainersInner update( - String resourceGroupName, - String storageContainerName, - StorageContainersUpdateRequest storageContainers, - Context context); + 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. @@ -253,7 +243,7 @@ StorageContainersInner update( /** * 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. @@ -267,7 +257,7 @@ StorageContainersInner update( /** * 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}. @@ -278,7 +268,7 @@ StorageContainersInner update( /** * 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. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java new file mode 100644 index 000000000000..c5f5fb016c72 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java @@ -0,0 +1,178 @@ +// Copyright (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.UpdateRunInner; + +/** + * An instance of this class provides access to all the operations defined in UpdateRunsClient. + */ +public interface UpdateRunsClient { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String updateName, + Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String updateName, + String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, UpdateRunInner updateRunsProperties, Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner put(String resourceGroupName, String clusterName, String updateName, String updateRunName, + UpdateRunInner updateRunsProperties); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java new file mode 100644 index 000000000000..665da1856102 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.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.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.UpdateSummariesInner; + +/** + * An instance of this class provides access to all the operations defined in UpdateSummariesOperationsClient. + */ +public interface UpdateSummariesOperationsClient { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner put(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java new file mode 100644 index 000000000000..abb24622a230 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.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.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.HciUpdateInner; + +/** + * An instance of this class provides access to all the operations defined in UpdatesClient. + */ +public interface UpdatesClient { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginPost(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginPost(String resourceGroupName, String clusterName, String updateName, + Context context); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String updateName, + Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String clusterName, String updateName, + HciUpdateInner updateProperties, Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HciUpdateInner put(String resourceGroupName, String clusterName, String updateName, + HciUpdateInner updateProperties); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HciUpdateInner get(String resourceGroupName, String clusterName, String updateName); +} 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 index 3cdddaffc2de..5a466690b02e 100644 --- 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 @@ -14,11 +14,13 @@ 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. */ +/** + * 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. @@ -28,12 +30,12 @@ public interface VirtualHardDisksOperationsClient { * @return a virtual hard disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualHardDiskName, Context context); + 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. @@ -47,26 +49,26 @@ Response getByResourceGroupWithResponse( /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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); + 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 virtual hard disk resource definition. + * @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. @@ -74,32 +76,32 @@ SyncPoller, VirtualHardDisksInner> beginCreate * @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); + 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 virtual hard disk resource definition. + * @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); + 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 virtual hard disk resource definition. + * @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. @@ -107,12 +109,12 @@ VirtualHardDisksInner createOrUpdate( * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHardDisksInner createOrUpdate( - String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context); + 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. @@ -125,7 +127,7 @@ VirtualHardDisksInner createOrUpdate( /** * 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. @@ -135,12 +137,12 @@ VirtualHardDisksInner createOrUpdate( * @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); + 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. @@ -152,7 +154,7 @@ SyncPoller, Void> beginDelete( /** * 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. @@ -165,25 +167,25 @@ SyncPoller, Void> beginDelete( /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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); + 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 virtual hard disk resource patch definition. + * @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. @@ -191,33 +193,30 @@ SyncPoller, VirtualHardDisksInner> beginUpdate * @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); + 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 virtual hard disk resource patch definition. + * @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); + 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 virtual hard disk resource patch definition. + * @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. @@ -225,16 +224,13 @@ VirtualHardDisksInner update( * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHardDisksInner update( - String resourceGroupName, - String virtualHardDiskName, - VirtualHardDisksUpdateRequest virtualHardDisks, - Context context); + 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. @@ -247,7 +243,7 @@ VirtualHardDisksInner update( /** * 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. @@ -261,7 +257,7 @@ VirtualHardDisksInner update( /** * 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}. @@ -272,7 +268,7 @@ VirtualHardDisksInner update( /** * 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. 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 index 76dba84e1664..5006110e708a 100644 --- 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 @@ -14,13 +14,15 @@ 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. */ +/** + * 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. + * 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. @@ -32,9 +34,9 @@ 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. + * 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. @@ -46,26 +48,26 @@ public interface VirtualMachineInstancesClient { /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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); + SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance); /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -73,16 +75,16 @@ SyncPoller, VirtualMachineInstanceInner> * @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); + SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context); /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -94,10 +96,10 @@ SyncPoller, VirtualMachineInstanceInner> /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -105,14 +107,14 @@ SyncPoller, VirtualMachineInstanceInner> * @return the virtual machine instance resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInstanceInner createOrUpdate( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context); + 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. + * 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. @@ -123,9 +125,9 @@ VirtualMachineInstanceInner createOrUpdate( /** * 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. + * 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. @@ -137,9 +139,9 @@ VirtualMachineInstanceInner createOrUpdate( /** * 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. + * 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. @@ -149,9 +151,9 @@ VirtualMachineInstanceInner createOrUpdate( /** * 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. + * 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. @@ -162,25 +164,25 @@ VirtualMachineInstanceInner createOrUpdate( /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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); + SyncPoller, VirtualMachineInstanceInner> beginUpdate(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance); /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -188,15 +190,15 @@ SyncPoller, VirtualMachineInstanceInner> * @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); + SyncPoller, VirtualMachineInstanceInner> beginUpdate(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context); /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -207,10 +209,10 @@ SyncPoller, VirtualMachineInstanceInner> /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -218,14 +220,14 @@ SyncPoller, VirtualMachineInstanceInner> * @return the virtual machine instance resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInstanceInner update( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context); + 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. + * 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. @@ -236,9 +238,9 @@ VirtualMachineInstanceInner update( /** * 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. + * 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. @@ -246,14 +248,14 @@ VirtualMachineInstanceInner update( * @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); + 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. + * 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. @@ -264,9 +266,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -278,9 +280,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -291,9 +293,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -301,14 +303,14 @@ SyncPoller, VirtualMachineInstanceInner> * @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); + 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. + * 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. @@ -319,9 +321,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -333,9 +335,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -346,9 +348,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -356,14 +358,14 @@ SyncPoller, VirtualMachineInstanceInner> * @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); + 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. + * 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. @@ -374,9 +376,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -388,9 +390,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. @@ -401,9 +403,9 @@ SyncPoller, VirtualMachineInstanceInner> /** * 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. + * 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. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java new file mode 100644 index 000000000000..509d46b0756d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ArcIdentity details. + */ +@Immutable +public final class ArcIdentityResponseInner implements JsonSerializable { + /* + * ArcIdentity properties. + */ + private ArcIdentityResponseProperties innerProperties; + + /** + * Creates an instance of ArcIdentityResponseInner class. + */ + public ArcIdentityResponseInner() { + } + + /** + * Get the innerProperties property: ArcIdentity properties. + * + * @return the innerProperties value. + */ + private ArcIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcIdentityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcIdentityResponseInner 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 ArcIdentityResponseInner. + */ + public static ArcIdentityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcIdentityResponseInner deserializedArcIdentityResponseInner = new ArcIdentityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedArcIdentityResponseInner.innerProperties + = ArcIdentityResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedArcIdentityResponseInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java new file mode 100644 index 000000000000..a2bd1a61b1a1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java @@ -0,0 +1,178 @@ +// Copyright (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; + +/** + * The ArcIdentityResponseProperties model. + */ +@Fluent +public final class ArcIdentityResponseProperties implements JsonSerializable { + /* + * The arcApplicationClientId property. + */ + private String arcApplicationClientId; + + /* + * The arcApplicationTenantId property. + */ + private String arcApplicationTenantId; + + /* + * The arcServicePrincipalObjectId property. + */ + private String arcServicePrincipalObjectId; + + /* + * The arcApplicationObjectId property. + */ + private String arcApplicationObjectId; + + /** + * Creates an instance of ArcIdentityResponseProperties class. + */ + public ArcIdentityResponseProperties() { + } + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arcApplicationClientId", this.arcApplicationClientId); + jsonWriter.writeStringField("arcApplicationTenantId", this.arcApplicationTenantId); + jsonWriter.writeStringField("arcServicePrincipalObjectId", this.arcServicePrincipalObjectId); + jsonWriter.writeStringField("arcApplicationObjectId", this.arcApplicationObjectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcIdentityResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcIdentityResponseProperties 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 ArcIdentityResponseProperties. + */ + public static ArcIdentityResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcIdentityResponseProperties deserializedArcIdentityResponseProperties + = new ArcIdentityResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arcApplicationClientId".equals(fieldName)) { + deserializedArcIdentityResponseProperties.arcApplicationClientId = reader.getString(); + } else if ("arcApplicationTenantId".equals(fieldName)) { + deserializedArcIdentityResponseProperties.arcApplicationTenantId = reader.getString(); + } else if ("arcServicePrincipalObjectId".equals(fieldName)) { + deserializedArcIdentityResponseProperties.arcServicePrincipalObjectId = reader.getString(); + } else if ("arcApplicationObjectId".equals(fieldName)) { + deserializedArcIdentityResponseProperties.arcApplicationObjectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedArcIdentityResponseProperties; + }); + } +} 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 new file mode 100644 index 000000000000..15a62cf20d63 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -0,0 +1,335 @@ +// Copyright (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.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * ArcSetting details. + */ +@Fluent +public final class ArcSettingInner extends ProxyResource { + /* + * ArcSetting properties. + */ + private ArcSettingProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of ArcSettingInner class. + */ + public ArcSettingInner() { + } + + /** + * Get the innerProperties property: ArcSetting properties. + * + * @return the innerProperties value. + */ + private ArcSettingProperties 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 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 provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + public String arcInstanceResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().arcInstanceResourceGroup(); + } + + /** + * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcInstanceResourceGroup(arcInstanceResourceGroup); + return this; + } + + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + /** + * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ArcSettingAggregateState aggregateState() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); + } + + /** + * Get the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + public List perNodeDetails() { + return this.innerProperties() == null ? null : this.innerProperties().perNodeDetails(); + } + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withConnectivityProperties(Object connectivityProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withConnectivityProperties(connectivityProperties); + return this; + } + + /** + * Get the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + public List defaultExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().defaultExtensions(); + } + + /** + * 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 ArcSettingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcSettingInner 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 ArcSettingInner. + */ + public static ArcSettingInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcSettingInner deserializedArcSettingInner = new ArcSettingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedArcSettingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedArcSettingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedArcSettingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedArcSettingInner.innerProperties = ArcSettingProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedArcSettingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedArcSettingInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java new file mode 100644 index 000000000000..915d349b2fe6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java @@ -0,0 +1,315 @@ +// Copyright (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.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * ArcSetting properties. + */ +@Fluent +public final class ArcSettingProperties implements JsonSerializable { + /* + * Provisioning state of the ArcSetting proxy resource. + */ + private ProvisioningState provisioningState; + + /* + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. + */ + private String arcInstanceResourceGroup; + + /* + * App id of arc AAD identity. + */ + private String arcApplicationClientId; + + /* + * Tenant id of arc AAD identity. + */ + private String arcApplicationTenantId; + + /* + * Object id of arc AAD service principal. + */ + private String arcServicePrincipalObjectId; + + /* + * Object id of arc AAD identity. + */ + private String arcApplicationObjectId; + + /* + * Aggregate state of Arc agent across the nodes in this HCI cluster. + */ + private ArcSettingAggregateState aggregateState; + + /* + * State of Arc agent in each of the nodes. + */ + private List perNodeDetails; + + /* + * contains connectivity related configuration for ARC resources + */ + private Object connectivityProperties; + + /* + * Properties for each of the default extensions category + */ + private List defaultExtensions; + + /** + * Creates an instance of ArcSettingProperties class. + */ + public ArcSettingProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + public String arcInstanceResourceGroup() { + return this.arcInstanceResourceGroup; + } + + /** + * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + this.arcInstanceResourceGroup = arcInstanceResourceGroup; + return this; + } + + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + + /** + * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ArcSettingAggregateState aggregateState() { + return this.aggregateState; + } + + /** + * Get the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + public List perNodeDetails() { + return this.perNodeDetails; + } + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.connectivityProperties; + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withConnectivityProperties(Object connectivityProperties) { + this.connectivityProperties = connectivityProperties; + return this; + } + + /** + * Get the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + public List defaultExtensions() { + return this.defaultExtensions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (perNodeDetails() != null) { + perNodeDetails().forEach(e -> e.validate()); + } + if (defaultExtensions() != null) { + defaultExtensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arcInstanceResourceGroup", this.arcInstanceResourceGroup); + jsonWriter.writeStringField("arcApplicationClientId", this.arcApplicationClientId); + jsonWriter.writeStringField("arcApplicationTenantId", this.arcApplicationTenantId); + jsonWriter.writeStringField("arcServicePrincipalObjectId", this.arcServicePrincipalObjectId); + jsonWriter.writeStringField("arcApplicationObjectId", this.arcApplicationObjectId); + jsonWriter.writeUntypedField("connectivityProperties", this.connectivityProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcSettingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcSettingProperties 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 ArcSettingProperties. + */ + public static ArcSettingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcSettingProperties deserializedArcSettingProperties = new ArcSettingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedArcSettingProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("arcInstanceResourceGroup".equals(fieldName)) { + deserializedArcSettingProperties.arcInstanceResourceGroup = reader.getString(); + } else if ("arcApplicationClientId".equals(fieldName)) { + deserializedArcSettingProperties.arcApplicationClientId = reader.getString(); + } else if ("arcApplicationTenantId".equals(fieldName)) { + deserializedArcSettingProperties.arcApplicationTenantId = reader.getString(); + } else if ("arcServicePrincipalObjectId".equals(fieldName)) { + deserializedArcSettingProperties.arcServicePrincipalObjectId = reader.getString(); + } else if ("arcApplicationObjectId".equals(fieldName)) { + deserializedArcSettingProperties.arcApplicationObjectId = reader.getString(); + } else if ("aggregateState".equals(fieldName)) { + deserializedArcSettingProperties.aggregateState + = ArcSettingAggregateState.fromString(reader.getString()); + } else if ("perNodeDetails".equals(fieldName)) { + List perNodeDetails = reader.readArray(reader1 -> PerNodeState.fromJson(reader1)); + deserializedArcSettingProperties.perNodeDetails = perNodeDetails; + } else if ("connectivityProperties".equals(fieldName)) { + deserializedArcSettingProperties.connectivityProperties = reader.readUntyped(); + } else if ("defaultExtensions".equals(fieldName)) { + List defaultExtensions + = reader.readArray(reader1 -> DefaultExtensionDetails.fromJson(reader1)); + deserializedArcSettingProperties.defaultExtensions = defaultExtensions; + } else { + reader.skipChildren(); + } + } + + return deserializedArcSettingProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java new file mode 100644 index 000000000000..0e71e801fd3a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java @@ -0,0 +1,93 @@ +// Copyright (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; + +/** + * ArcSettings properties. + */ +@Fluent +public final class ArcSettingsPatchProperties implements JsonSerializable { + /* + * contains connectivity related configuration for ARC resources + */ + private Object connectivityProperties; + + /** + * Creates an instance of ArcSettingsPatchProperties class. + */ + public ArcSettingsPatchProperties() { + } + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.connectivityProperties; + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingsPatchProperties object itself. + */ + public ArcSettingsPatchProperties withConnectivityProperties(Object connectivityProperties) { + this.connectivityProperties = connectivityProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("connectivityProperties", this.connectivityProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcSettingsPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcSettingsPatchProperties 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 ArcSettingsPatchProperties. + */ + public static ArcSettingsPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcSettingsPatchProperties deserializedArcSettingsPatchProperties = new ArcSettingsPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectivityProperties".equals(fieldName)) { + deserializedArcSettingsPatchProperties.connectivityProperties = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedArcSettingsPatchProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java new file mode 100644 index 000000000000..13f59c8283c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster Identity details. + */ +@Immutable +public final class ClusterIdentityResponseInner implements JsonSerializable { + /* + * Cluster identity properties. + */ + private ClusterIdentityResponseProperties innerProperties; + + /** + * Creates an instance of ClusterIdentityResponseInner class. + */ + public ClusterIdentityResponseInner() { + } + + /** + * Get the innerProperties property: Cluster identity properties. + * + * @return the innerProperties value. + */ + private ClusterIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterIdentityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterIdentityResponseInner 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 ClusterIdentityResponseInner. + */ + public static ClusterIdentityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterIdentityResponseInner deserializedClusterIdentityResponseInner = new ClusterIdentityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterIdentityResponseInner.innerProperties + = ClusterIdentityResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterIdentityResponseInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java new file mode 100644 index 000000000000..5f455a36a519 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java @@ -0,0 +1,178 @@ +// Copyright (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; + +/** + * The ClusterIdentityResponseProperties model. + */ +@Fluent +public final class ClusterIdentityResponseProperties implements JsonSerializable { + /* + * The aadClientId property. + */ + private String aadClientId; + + /* + * The aadTenantId property. + */ + private String aadTenantId; + + /* + * The aadServicePrincipalObjectId property. + */ + private String aadServicePrincipalObjectId; + + /* + * The aadApplicationObjectId property. + */ + private String aadApplicationObjectId; + + /** + * Creates an instance of ClusterIdentityResponseProperties class. + */ + public ClusterIdentityResponseProperties() { + } + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aadClientId", this.aadClientId); + jsonWriter.writeStringField("aadTenantId", this.aadTenantId); + jsonWriter.writeStringField("aadServicePrincipalObjectId", this.aadServicePrincipalObjectId); + jsonWriter.writeStringField("aadApplicationObjectId", this.aadApplicationObjectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterIdentityResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterIdentityResponseProperties 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 ClusterIdentityResponseProperties. + */ + public static ClusterIdentityResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterIdentityResponseProperties deserializedClusterIdentityResponseProperties + = new ClusterIdentityResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aadClientId".equals(fieldName)) { + deserializedClusterIdentityResponseProperties.aadClientId = reader.getString(); + } else if ("aadTenantId".equals(fieldName)) { + deserializedClusterIdentityResponseProperties.aadTenantId = reader.getString(); + } else if ("aadServicePrincipalObjectId".equals(fieldName)) { + deserializedClusterIdentityResponseProperties.aadServicePrincipalObjectId = reader.getString(); + } else if ("aadApplicationObjectId".equals(fieldName)) { + deserializedClusterIdentityResponseProperties.aadApplicationObjectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterIdentityResponseProperties; + }); + } +} 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 new file mode 100644 index 000000000000..2efba3096374 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java @@ -0,0 +1,564 @@ +// Copyright (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.ClusterDesiredProperties; +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.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; +import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** + * Cluster details. + */ +@Fluent +public final class ClusterInner extends Resource { + /* + * Identity of Cluster resource + */ + private ManagedServiceIdentity innerIdentity; + + /* + * Cluster properties. + */ + private ClusterProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of ClusterInner class. + */ + public ClusterInner() { + } + + /** + * Get the innerIdentity property: Identity of Cluster resource. + * + * @return the innerIdentity value. + */ + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; + } + + /** + * Get the innerProperties property: Cluster properties. + * + * @return the innerProperties value. + */ + private ClusterProperties 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 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType typeIdentityType() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withTypeIdentityType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: Status of the cluster agent. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + public ConnectivityStatus connectivityStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityStatus(); + } + + /** + * Get the cloudId property: Unique, immutable resource id. + * + * @return the cloudId value. + */ + public String cloudId() { + return this.innerProperties() == null ? null : this.innerProperties().cloudId(); + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); + } + + /** + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); + } + + /** + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().softwareAssuranceProperties(); + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withDesiredProperties(desiredProperties); + return this; + } + + /** + * Get the reportedProperties property: Properties reported by cluster agent. + * + * @return the reportedProperties value. + */ + public ClusterReportedProperties reportedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().reportedProperties(); + } + + /** + * Get the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().isolatedVmAttestationConfiguration(); + } + + /** + * Get the trialDaysRemaining property: Number of days remaining in the trial period. + * + * @return the trialDaysRemaining value. + */ + public Float trialDaysRemaining() { + return this.innerProperties() == null ? null : this.innerProperties().trialDaysRemaining(); + } + + /** + * Get the billingModel property: Type of billing applied to the resource. + * + * @return the billingModel value. + */ + public String billingModel() { + return this.innerProperties() == null ? null : this.innerProperties().billingModel(); + } + + /** + * Get the registrationTimestamp property: First cluster sync timestamp. + * + * @return the registrationTimestamp value. + */ + public OffsetDateTime registrationTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().registrationTimestamp(); + } + + /** + * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. + * + * @return the lastSyncTimestamp value. + */ + public OffsetDateTime lastSyncTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastSyncTimestamp(); + } + + /** + * Get the lastBillingTimestamp property: Most recent billing meter timestamp. + * + * @return the lastBillingTimestamp value. + */ + public OffsetDateTime lastBillingTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastBillingTimestamp(); + } + + /** + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); + } + + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceProviderObjectId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } + if (innerProperties() != null) { + innerProperties().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("identity", this.innerIdentity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInner 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 ClusterInner. + */ + public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInner deserializedClusterInner = new ClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedClusterInner.innerIdentity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterInner.innerProperties = ClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java new file mode 100644 index 000000000000..649afd5a489b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java @@ -0,0 +1,181 @@ +// Copyright (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.ClusterDesiredProperties; +import java.io.IOException; + +/** + * Cluster properties. + */ +@Fluent +public final class ClusterPatchProperties implements JsonSerializable { + /* + * Endpoint configured for management from the Azure portal + */ + private String cloudManagementEndpoint; + + /* + * App id of cluster AAD identity. + */ + private String aadClientId; + + /* + * Tenant id of cluster AAD identity. + */ + private String aadTenantId; + + /* + * Desired properties of the cluster. + */ + private ClusterDesiredProperties desiredProperties; + + /** + * Creates an instance of ClusterPatchProperties class. + */ + public ClusterPatchProperties() { + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.cloudManagementEndpoint; + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { + this.cloudManagementEndpoint = cloudManagementEndpoint; + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.desiredProperties; + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { + this.desiredProperties = desiredProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (desiredProperties() != null) { + desiredProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudManagementEndpoint", this.cloudManagementEndpoint); + jsonWriter.writeStringField("aadClientId", this.aadClientId); + jsonWriter.writeStringField("aadTenantId", this.aadTenantId); + jsonWriter.writeJsonField("desiredProperties", this.desiredProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchProperties 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 ClusterPatchProperties. + */ + public static ClusterPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchProperties deserializedClusterPatchProperties = new ClusterPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudManagementEndpoint".equals(fieldName)) { + deserializedClusterPatchProperties.cloudManagementEndpoint = reader.getString(); + } else if ("aadClientId".equals(fieldName)) { + deserializedClusterPatchProperties.aadClientId = reader.getString(); + } else if ("aadTenantId".equals(fieldName)) { + deserializedClusterPatchProperties.aadTenantId = reader.getString(); + } else if ("desiredProperties".equals(fieldName)) { + deserializedClusterPatchProperties.desiredProperties = ClusterDesiredProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchProperties; + }); + } +} 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 new file mode 100644 index 000000000000..5617f545d6d5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -0,0 +1,497 @@ +// Copyright (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.CoreUtils; +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.ClusterDesiredProperties; +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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; +import com.azure.resourcemanager.azurestackhci.models.Status; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Cluster properties. + */ +@Fluent +public final class ClusterProperties implements JsonSerializable { + /* + * Provisioning state. + */ + private ProvisioningState provisioningState; + + /* + * Status of the cluster agent. + */ + private Status status; + + /* + * Overall connectivity status for the cluster resource. + */ + private ConnectivityStatus connectivityStatus; + + /* + * Unique, immutable resource id. + */ + private String cloudId; + + /* + * Endpoint configured for management from the Azure portal. + */ + private String cloudManagementEndpoint; + + /* + * App id of cluster AAD identity. + */ + private String aadClientId; + + /* + * Tenant id of cluster AAD identity. + */ + private String aadTenantId; + + /* + * Object id of cluster AAD identity. + */ + private String aadApplicationObjectId; + + /* + * Id of cluster identity service principal. + */ + private String aadServicePrincipalObjectId; + + /* + * Software Assurance properties of the cluster. + */ + private SoftwareAssuranceProperties softwareAssuranceProperties; + + /* + * Desired properties of the cluster. + */ + private ClusterDesiredProperties desiredProperties; + + /* + * Properties reported by cluster agent. + */ + private ClusterReportedProperties reportedProperties; + + /* + * Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. + */ + private IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration; + + /* + * Number of days remaining in the trial period. + */ + private Float trialDaysRemaining; + + /* + * Type of billing applied to the resource. + */ + private String billingModel; + + /* + * First cluster sync timestamp. + */ + private OffsetDateTime registrationTimestamp; + + /* + * Most recent cluster sync timestamp. + */ + private OffsetDateTime lastSyncTimestamp; + + /* + * Most recent billing meter timestamp. + */ + private OffsetDateTime lastBillingTimestamp; + + /* + * Region specific DataPath Endpoint of the cluster. + */ + private String serviceEndpoint; + + /* + * Object id of RP Service Principal + */ + private String resourceProviderObjectId; + + /** + * Creates an instance of ClusterProperties class. + */ + public ClusterProperties() { + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the cluster agent. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + public ConnectivityStatus connectivityStatus() { + return this.connectivityStatus; + } + + /** + * Get the cloudId property: Unique, immutable resource id. + * + * @return the cloudId value. + */ + public String cloudId() { + return this.cloudId; + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.cloudManagementEndpoint; + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { + this.cloudManagementEndpoint = cloudManagementEndpoint; + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.softwareAssuranceProperties; + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.softwareAssuranceProperties = softwareAssuranceProperties; + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.desiredProperties; + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { + this.desiredProperties = desiredProperties; + return this; + } + + /** + * Get the reportedProperties property: Properties reported by cluster agent. + * + * @return the reportedProperties value. + */ + public ClusterReportedProperties reportedProperties() { + return this.reportedProperties; + } + + /** + * Get the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.isolatedVmAttestationConfiguration; + } + + /** + * Get the trialDaysRemaining property: Number of days remaining in the trial period. + * + * @return the trialDaysRemaining value. + */ + public Float trialDaysRemaining() { + return this.trialDaysRemaining; + } + + /** + * Get the billingModel property: Type of billing applied to the resource. + * + * @return the billingModel value. + */ + public String billingModel() { + return this.billingModel; + } + + /** + * Get the registrationTimestamp property: First cluster sync timestamp. + * + * @return the registrationTimestamp value. + */ + public OffsetDateTime registrationTimestamp() { + return this.registrationTimestamp; + } + + /** + * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. + * + * @return the lastSyncTimestamp value. + */ + public OffsetDateTime lastSyncTimestamp() { + return this.lastSyncTimestamp; + } + + /** + * Get the lastBillingTimestamp property: Most recent billing meter timestamp. + * + * @return the lastBillingTimestamp value. + */ + public OffsetDateTime lastBillingTimestamp() { + return this.lastBillingTimestamp; + } + + /** + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.resourceProviderObjectId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (softwareAssuranceProperties() != null) { + softwareAssuranceProperties().validate(); + } + if (desiredProperties() != null) { + desiredProperties().validate(); + } + if (reportedProperties() != null) { + reportedProperties().validate(); + } + if (isolatedVmAttestationConfiguration() != null) { + isolatedVmAttestationConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudManagementEndpoint", this.cloudManagementEndpoint); + jsonWriter.writeStringField("aadClientId", this.aadClientId); + jsonWriter.writeStringField("aadTenantId", this.aadTenantId); + jsonWriter.writeStringField("aadApplicationObjectId", this.aadApplicationObjectId); + jsonWriter.writeStringField("aadServicePrincipalObjectId", this.aadServicePrincipalObjectId); + jsonWriter.writeJsonField("softwareAssuranceProperties", this.softwareAssuranceProperties); + jsonWriter.writeJsonField("desiredProperties", this.desiredProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterProperties 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 ClusterProperties. + */ + public static ClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterProperties deserializedClusterProperties = new ClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedClusterProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedClusterProperties.status = Status.fromString(reader.getString()); + } else if ("connectivityStatus".equals(fieldName)) { + deserializedClusterProperties.connectivityStatus + = ConnectivityStatus.fromString(reader.getString()); + } else if ("cloudId".equals(fieldName)) { + deserializedClusterProperties.cloudId = reader.getString(); + } else if ("cloudManagementEndpoint".equals(fieldName)) { + deserializedClusterProperties.cloudManagementEndpoint = reader.getString(); + } else if ("aadClientId".equals(fieldName)) { + deserializedClusterProperties.aadClientId = reader.getString(); + } else if ("aadTenantId".equals(fieldName)) { + deserializedClusterProperties.aadTenantId = reader.getString(); + } else if ("aadApplicationObjectId".equals(fieldName)) { + deserializedClusterProperties.aadApplicationObjectId = reader.getString(); + } else if ("aadServicePrincipalObjectId".equals(fieldName)) { + deserializedClusterProperties.aadServicePrincipalObjectId = reader.getString(); + } else if ("softwareAssuranceProperties".equals(fieldName)) { + deserializedClusterProperties.softwareAssuranceProperties + = SoftwareAssuranceProperties.fromJson(reader); + } else if ("desiredProperties".equals(fieldName)) { + deserializedClusterProperties.desiredProperties = ClusterDesiredProperties.fromJson(reader); + } else if ("reportedProperties".equals(fieldName)) { + deserializedClusterProperties.reportedProperties = ClusterReportedProperties.fromJson(reader); + } else if ("isolatedVmAttestationConfiguration".equals(fieldName)) { + deserializedClusterProperties.isolatedVmAttestationConfiguration + = IsolatedVmAttestationConfiguration.fromJson(reader); + } else if ("trialDaysRemaining".equals(fieldName)) { + deserializedClusterProperties.trialDaysRemaining = reader.getNullable(JsonReader::getFloat); + } else if ("billingModel".equals(fieldName)) { + deserializedClusterProperties.billingModel = reader.getString(); + } else if ("registrationTimestamp".equals(fieldName)) { + deserializedClusterProperties.registrationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSyncTimestamp".equals(fieldName)) { + deserializedClusterProperties.lastSyncTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastBillingTimestamp".equals(fieldName)) { + deserializedClusterProperties.lastBillingTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("serviceEndpoint".equals(fieldName)) { + deserializedClusterProperties.serviceEndpoint = reader.getString(); + } else if ("resourceProviderObjectId".equals(fieldName)) { + deserializedClusterProperties.resourceProviderObjectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingInner.java new file mode 100644 index 000000000000..dea3a5a2f313 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingInner.java @@ -0,0 +1,260 @@ +// Copyright (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.DeploymentConfiguration; +import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.ReportedProperties; +import java.io.IOException; +import java.util.List; + +/** + * Edge device resource. + */ +@Fluent +public final class DeploymentSettingInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DeploymentSettingsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of DeploymentSettingInner class. + */ + public DeploymentSettingInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private DeploymentSettingsProperties 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 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 provisioningState property: DeploymentSetting provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: DeploymentSetting provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the DeploymentSettingInner object itself. + */ + public DeploymentSettingInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentSettingsProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster. + * + * @return the arcNodeResourceIds value. + */ + public List arcNodeResourceIds() { + return this.innerProperties() == null ? null : this.innerProperties().arcNodeResourceIds(); + } + + /** + * Set the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster. + * + * @param arcNodeResourceIds the arcNodeResourceIds value to set. + * @return the DeploymentSettingInner object itself. + */ + public DeploymentSettingInner withArcNodeResourceIds(List arcNodeResourceIds) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentSettingsProperties(); + } + this.innerProperties().withArcNodeResourceIds(arcNodeResourceIds); + return this; + } + + /** + * Get the deploymentMode property: The deployment mode for cluster deployment. + * + * @return the deploymentMode value. + */ + public DeploymentMode deploymentMode() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentMode(); + } + + /** + * Set the deploymentMode property: The deployment mode for cluster deployment. + * + * @param deploymentMode the deploymentMode value to set. + * @return the DeploymentSettingInner object itself. + */ + public DeploymentSettingInner withDeploymentMode(DeploymentMode deploymentMode) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentSettingsProperties(); + } + this.innerProperties().withDeploymentMode(deploymentMode); + return this; + } + + /** + * Get the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @return the deploymentConfiguration value. + */ + public DeploymentConfiguration deploymentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentConfiguration(); + } + + /** + * Set the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @param deploymentConfiguration the deploymentConfiguration value to set. + * @return the DeploymentSettingInner object itself. + */ + public DeploymentSettingInner withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentSettingsProperties(); + } + this.innerProperties().withDeploymentConfiguration(deploymentConfiguration); + return this; + } + + /** + * Get the reportedProperties property: Deployment Status reported from cluster. + * + * @return the reportedProperties value. + */ + public ReportedProperties reportedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().reportedProperties(); + } + + /** + * 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 DeploymentSettingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentSettingInner 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 DeploymentSettingInner. + */ + public static DeploymentSettingInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentSettingInner deserializedDeploymentSettingInner = new DeploymentSettingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeploymentSettingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeploymentSettingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeploymentSettingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeploymentSettingInner.innerProperties = DeploymentSettingsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDeploymentSettingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentSettingInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingsProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingsProperties.java new file mode 100644 index 000000000000..061de1d6296c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/DeploymentSettingsProperties.java @@ -0,0 +1,229 @@ +// Copyright (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.DeploymentConfiguration; +import com.azure.resourcemanager.azurestackhci.models.DeploymentMode; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.ReportedProperties; +import java.io.IOException; +import java.util.List; + +/** + * DeploymentSetting properties. + */ +@Fluent +public final class DeploymentSettingsProperties implements JsonSerializable { + /* + * DeploymentSetting provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Azure resource ids of Arc machines to be part of cluster. + */ + private List arcNodeResourceIds; + + /* + * The deployment mode for cluster deployment. + */ + private DeploymentMode deploymentMode; + + /* + * Scale units will contains list of deployment data + */ + private DeploymentConfiguration deploymentConfiguration; + + /* + * Deployment Status reported from cluster. + */ + private ReportedProperties reportedProperties; + + /** + * Creates an instance of DeploymentSettingsProperties class. + */ + public DeploymentSettingsProperties() { + } + + /** + * Get the provisioningState property: DeploymentSetting provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: DeploymentSetting provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the DeploymentSettingsProperties object itself. + */ + public DeploymentSettingsProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster. + * + * @return the arcNodeResourceIds value. + */ + public List arcNodeResourceIds() { + return this.arcNodeResourceIds; + } + + /** + * Set the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster. + * + * @param arcNodeResourceIds the arcNodeResourceIds value to set. + * @return the DeploymentSettingsProperties object itself. + */ + public DeploymentSettingsProperties withArcNodeResourceIds(List arcNodeResourceIds) { + this.arcNodeResourceIds = arcNodeResourceIds; + return this; + } + + /** + * Get the deploymentMode property: The deployment mode for cluster deployment. + * + * @return the deploymentMode value. + */ + public DeploymentMode deploymentMode() { + return this.deploymentMode; + } + + /** + * Set the deploymentMode property: The deployment mode for cluster deployment. + * + * @param deploymentMode the deploymentMode value to set. + * @return the DeploymentSettingsProperties object itself. + */ + public DeploymentSettingsProperties withDeploymentMode(DeploymentMode deploymentMode) { + this.deploymentMode = deploymentMode; + return this; + } + + /** + * Get the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @return the deploymentConfiguration value. + */ + public DeploymentConfiguration deploymentConfiguration() { + return this.deploymentConfiguration; + } + + /** + * Set the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @param deploymentConfiguration the deploymentConfiguration value to set. + * @return the DeploymentSettingsProperties object itself. + */ + public DeploymentSettingsProperties withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { + this.deploymentConfiguration = deploymentConfiguration; + return this; + } + + /** + * Get the reportedProperties property: Deployment Status reported from cluster. + * + * @return the reportedProperties value. + */ + public ReportedProperties reportedProperties() { + return this.reportedProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (arcNodeResourceIds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property arcNodeResourceIds in model DeploymentSettingsProperties")); + } + if (deploymentMode() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentMode in model DeploymentSettingsProperties")); + } + if (deploymentConfiguration() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentConfiguration in model DeploymentSettingsProperties")); + } else { + deploymentConfiguration().validate(); + } + if (reportedProperties() != null) { + reportedProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentSettingsProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("arcNodeResourceIds", this.arcNodeResourceIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("deploymentMode", + this.deploymentMode == null ? null : this.deploymentMode.toString()); + jsonWriter.writeJsonField("deploymentConfiguration", this.deploymentConfiguration); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentSettingsProperties 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 DeploymentSettingsProperties. + */ + public static DeploymentSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentSettingsProperties deserializedDeploymentSettingsProperties = new DeploymentSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arcNodeResourceIds".equals(fieldName)) { + List arcNodeResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedDeploymentSettingsProperties.arcNodeResourceIds = arcNodeResourceIds; + } else if ("deploymentMode".equals(fieldName)) { + deserializedDeploymentSettingsProperties.deploymentMode + = DeploymentMode.fromString(reader.getString()); + } else if ("deploymentConfiguration".equals(fieldName)) { + deserializedDeploymentSettingsProperties.deploymentConfiguration + = DeploymentConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedDeploymentSettingsProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("reportedProperties".equals(fieldName)) { + deserializedDeploymentSettingsProperties.reportedProperties = ReportedProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentSettingsProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceInner.java new file mode 100644 index 000000000000..42432683864a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceInner.java @@ -0,0 +1,202 @@ +// Copyright (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.DeviceConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.io.IOException; + +/** + * Edge device resource. + */ +@Fluent +public final class EdgeDeviceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EdgeDeviceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of EdgeDeviceInner class. + */ + public EdgeDeviceInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private EdgeDeviceProperties 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 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 deviceConfiguration property: Device Configuration. + * + * @return the deviceConfiguration value. + */ + public DeviceConfiguration deviceConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().deviceConfiguration(); + } + + /** + * Set the deviceConfiguration property: Device Configuration. + * + * @param deviceConfiguration the deviceConfiguration value to set. + * @return the EdgeDeviceInner object itself. + */ + public EdgeDeviceInner withDeviceConfiguration(DeviceConfiguration deviceConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new EdgeDeviceProperties(); + } + this.innerProperties().withDeviceConfiguration(deviceConfiguration); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of edgeDevice resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of edgeDevice resource. + * + * @param provisioningState the provisioningState value to set. + * @return the EdgeDeviceInner object itself. + */ + public EdgeDeviceInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new EdgeDeviceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + 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 EdgeDeviceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeDeviceInner 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 EdgeDeviceInner. + */ + public static EdgeDeviceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeDeviceInner deserializedEdgeDeviceInner = new EdgeDeviceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeDeviceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEdgeDeviceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEdgeDeviceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEdgeDeviceInner.innerProperties = EdgeDeviceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEdgeDeviceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeDeviceInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.java new file mode 100644 index 000000000000..6dc2746bd9b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/EdgeDeviceProperties.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.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 final class EdgeDeviceProperties implements JsonSerializable { + /* + * Device Configuration + */ + private DeviceConfiguration deviceConfiguration; + + /* + * Provisioning state of edgeDevice resource + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EdgeDeviceProperties class. + */ + public EdgeDeviceProperties() { + } + + /** + * Get the deviceConfiguration property: Device Configuration. + * + * @return the deviceConfiguration value. + */ + public DeviceConfiguration deviceConfiguration() { + return this.deviceConfiguration; + } + + /** + * Set the deviceConfiguration property: Device Configuration. + * + * @param deviceConfiguration the deviceConfiguration value to set. + * @return the EdgeDeviceProperties object itself. + */ + public EdgeDeviceProperties withDeviceConfiguration(DeviceConfiguration deviceConfiguration) { + this.deviceConfiguration = deviceConfiguration; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of edgeDevice resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of edgeDevice resource. + * + * @param provisioningState the provisioningState value to set. + * @return the EdgeDeviceProperties object itself. + */ + public EdgeDeviceProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deviceConfiguration() != null) { + deviceConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + 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(); + } + + /** + * Reads an instance of EdgeDeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeDeviceProperties 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 EdgeDeviceProperties. + */ + public static EdgeDeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeDeviceProperties deserializedEdgeDeviceProperties = new EdgeDeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceConfiguration".equals(fieldName)) { + deserializedEdgeDeviceProperties.deviceConfiguration = DeviceConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedEdgeDeviceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeDeviceProperties; + }); + } +} 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 new file mode 100644 index 000000000000..e942d3a82fe7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java @@ -0,0 +1,389 @@ +// Copyright (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.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ExtensionManagedBy; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Details of a particular extension in HCI Cluster. + */ +@Fluent +public final class ExtensionInner extends ProxyResource { + /* + * Describes Machine Extension Properties. + */ + private ExtensionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of ExtensionInner class. + */ + public ExtensionInner() { + } + + /** + * Get the innerProperties property: Describes Machine Extension Properties. + * + * @return the innerProperties value. + */ + private ExtensionProperties 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 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 provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ExtensionAggregateState aggregateState() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); + } + + /** + * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + public List perNodeExtensionDetails() { + return this.innerProperties() == null ? null : this.innerProperties().perNodeExtensionDetails(); + } + + /** + * Get the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + public ExtensionManagedBy managedBy() { + return this.innerProperties() == null ? null : this.innerProperties().managedBy(); + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + 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 ExtensionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionInner 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 ExtensionInner. + */ + public static ExtensionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionInner deserializedExtensionInner = new ExtensionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExtensionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExtensionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtensionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExtensionInner.innerProperties = ExtensionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedExtensionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java new file mode 100644 index 000000000000..fa183cc024b4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java @@ -0,0 +1,303 @@ +// Copyright (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; + +/** + * Describes the properties of a Machine Extension. This object mirrors the definition in HybridCompute. + */ +@Fluent +public final class ExtensionParameters implements JsonSerializable { + /* + * How the extension handler should be forced to update even if the extension configuration has not changed. + */ + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + private String publisher; + + /* + * Specifies the type of the extension; an example is "CustomScriptExtension". + */ + private String type; + + /* + * Specifies the version of the script handler. Latest version would be used if not specified. + */ + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. + */ + private Boolean autoUpgradeMinorVersion; + + /* + * Json formatted public settings for the extension. + */ + private Object settings; + + /* + * Protected settings (may contain secrets). + */ + private Object protectedSettings; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + private Boolean enableAutomaticUpgrade; + + /** + * Creates an instance of ExtensionParameters class. + */ + public ExtensionParameters() { + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + 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("forceUpdateTag", this.forceUpdateTag); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("typeHandlerVersion", this.typeHandlerVersion); + jsonWriter.writeBooleanField("autoUpgradeMinorVersion", this.autoUpgradeMinorVersion); + jsonWriter.writeUntypedField("settings", this.settings); + jsonWriter.writeUntypedField("protectedSettings", this.protectedSettings); + jsonWriter.writeBooleanField("enableAutomaticUpgrade", this.enableAutomaticUpgrade); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionParameters 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 ExtensionParameters. + */ + public static ExtensionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionParameters deserializedExtensionParameters = new ExtensionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forceUpdateTag".equals(fieldName)) { + deserializedExtensionParameters.forceUpdateTag = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedExtensionParameters.publisher = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtensionParameters.type = reader.getString(); + } else if ("typeHandlerVersion".equals(fieldName)) { + deserializedExtensionParameters.typeHandlerVersion = reader.getString(); + } else if ("autoUpgradeMinorVersion".equals(fieldName)) { + deserializedExtensionParameters.autoUpgradeMinorVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("settings".equals(fieldName)) { + deserializedExtensionParameters.settings = reader.readUntyped(); + } else if ("protectedSettings".equals(fieldName)) { + deserializedExtensionParameters.protectedSettings = reader.readUntyped(); + } else if ("enableAutomaticUpgrade".equals(fieldName)) { + deserializedExtensionParameters.enableAutomaticUpgrade = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionParameters; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java new file mode 100644 index 000000000000..354a2e911c09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.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.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.ExtensionPatchParameters; +import java.io.IOException; + +/** + * Describes Machine Extension Properties that can be updated. + */ +@Fluent +public final class ExtensionPatchProperties implements JsonSerializable { + /* + * Describes the properties of a Machine Extension that can be updated. + */ + private ExtensionPatchParameters extensionParameters; + + /** + * Creates an instance of ExtensionPatchProperties class. + */ + public ExtensionPatchProperties() { + } + + /** + * Get the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @return the extensionParameters value. + */ + public ExtensionPatchParameters extensionParameters() { + return this.extensionParameters; + } + + /** + * Set the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @param extensionParameters the extensionParameters value to set. + * @return the ExtensionPatchProperties object itself. + */ + public ExtensionPatchProperties withExtensionParameters(ExtensionPatchParameters extensionParameters) { + this.extensionParameters = extensionParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionParameters() != null) { + extensionParameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("extensionParameters", this.extensionParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionPatchProperties 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 ExtensionPatchProperties. + */ + public static ExtensionPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionPatchProperties deserializedExtensionPatchProperties = new ExtensionPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extensionParameters".equals(fieldName)) { + deserializedExtensionPatchProperties.extensionParameters + = ExtensionPatchParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionPatchProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java new file mode 100644 index 000000000000..29ecd1704ff5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java @@ -0,0 +1,359 @@ +// Copyright (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.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ExtensionManagedBy; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Status of Arc Extension for a particular node in HCI Cluster. + */ +@Fluent +public final class ExtensionProperties implements JsonSerializable { + /* + * Provisioning state of the Extension proxy resource. + */ + private ProvisioningState provisioningState; + + /* + * Parameters specific to this extension type. + */ + private ExtensionParameters innerExtensionParameters; + + /* + * Aggregate state of Arc Extensions across the nodes in this HCI cluster. + */ + private ExtensionAggregateState aggregateState; + + /* + * State of Arc Extension in each of the nodes. + */ + private List perNodeExtensionDetails; + + /* + * Indicates if the extension is managed by azure or the user. + */ + private ExtensionManagedBy managedBy; + + /** + * Creates an instance of ExtensionProperties class. + */ + public ExtensionProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the innerExtensionParameters property: Parameters specific to this extension type. + * + * @return the innerExtensionParameters value. + */ + private ExtensionParameters innerExtensionParameters() { + return this.innerExtensionParameters; + } + + /** + * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ExtensionAggregateState aggregateState() { + return this.aggregateState; + } + + /** + * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + public List perNodeExtensionDetails() { + return this.perNodeExtensionDetails; + } + + /** + * Get the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + public ExtensionManagedBy managedBy() { + return this.managedBy; + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withForceUpdateTag(String forceUpdateTag) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withPublisher(String publisher) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withType(String type) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerExtensionParameters() == null + ? null + : this.innerExtensionParameters().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withSettings(Object settings) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withProtectedSettings(Object protectedSettings) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerExtensionParameters() == null + ? null + : this.innerExtensionParameters().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerExtensionParameters() != null) { + innerExtensionParameters().validate(); + } + if (perNodeExtensionDetails() != null) { + perNodeExtensionDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("extensionParameters", this.innerExtensionParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionProperties 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 ExtensionProperties. + */ + public static ExtensionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionProperties deserializedExtensionProperties = new ExtensionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedExtensionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("extensionParameters".equals(fieldName)) { + deserializedExtensionProperties.innerExtensionParameters = ExtensionParameters.fromJson(reader); + } else if ("aggregateState".equals(fieldName)) { + deserializedExtensionProperties.aggregateState + = ExtensionAggregateState.fromString(reader.getString()); + } else if ("perNodeExtensionDetails".equals(fieldName)) { + List perNodeExtensionDetails + = reader.readArray(reader1 -> PerNodeExtensionState.fromJson(reader1)); + deserializedExtensionProperties.perNodeExtensionDetails = perNodeExtensionDetails; + } else if ("managedBy".equals(fieldName)) { + deserializedExtensionProperties.managedBy = ExtensionManagedBy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionProperties; + }); + } +} 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 index fe985b0dc742..ceada5663ff1 100644 --- 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 @@ -6,6 +6,10 @@ 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; @@ -13,72 +17,67 @@ import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties under the gallery image resource. */ +/** + * Properties under the gallery image resource. + */ @Fluent -public final class GalleryImageProperties { +public final class GalleryImageProperties implements JsonSerializable { /* * Storage ContainerID of the storage container to be used for gallery image */ - @JsonProperty(value = "containerId") private String containerId; /* * location of the image the gallery image should be created from */ - @JsonProperty(value = "imagePath") private String imagePath; /* * Operating system type that the gallery image uses [Windows, Linux] */ - @JsonProperty(value = "osType", required = true) private OperatingSystemTypes osType; /* * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] */ - @JsonProperty(value = "cloudInitDataSource") private CloudInitDataSource cloudInitDataSource; /* * The hypervisor generation of the Virtual Machine [V1, V2] */ - @JsonProperty(value = "hyperVGeneration") private HyperVGeneration hyperVGeneration; /* * This is the gallery image definition identifier. */ - @JsonProperty(value = "identifier") private GalleryImageIdentifier identifier; /* * Specifies information about the gallery image version that you want to create or update. */ - @JsonProperty(value = "version") private GalleryImageVersion version; /* * Provisioning state of the gallery image. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * The observed state of gallery images */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private GalleryImageStatus status; - /** Creates an instance of GalleryImageProperties class. */ + /** + * 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() { @@ -87,7 +86,7 @@ public String 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. */ @@ -98,7 +97,7 @@ public GalleryImageProperties withContainerId(String containerId) { /** * Get the imagePath property: location of the image the gallery image should be created from. - * + * * @return the imagePath value. */ public String imagePath() { @@ -107,7 +106,7 @@ public String 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. */ @@ -118,7 +117,7 @@ public GalleryImageProperties withImagePath(String imagePath) { /** * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. - * + * * @return the osType value. */ public OperatingSystemTypes osType() { @@ -127,7 +126,7 @@ public OperatingSystemTypes 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. */ @@ -139,7 +138,7 @@ public GalleryImageProperties withOsType(OperatingSystemTypes osType) { /** * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init * [NoCloud, Azure]. - * + * * @return the cloudInitDataSource value. */ public CloudInitDataSource cloudInitDataSource() { @@ -149,7 +148,7 @@ public CloudInitDataSource 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. */ @@ -160,7 +159,7 @@ public GalleryImageProperties withCloudInitDataSource(CloudInitDataSource cloudI /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -169,7 +168,7 @@ public HyperVGeneration 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. */ @@ -180,7 +179,7 @@ public GalleryImageProperties withHyperVGeneration(HyperVGeneration hyperVGenera /** * Get the identifier property: This is the gallery image definition identifier. - * + * * @return the identifier value. */ public GalleryImageIdentifier identifier() { @@ -189,7 +188,7 @@ public GalleryImageIdentifier identifier() { /** * Set the identifier property: This is the gallery image definition identifier. - * + * * @param identifier the identifier value to set. * @return the GalleryImageProperties object itself. */ @@ -201,7 +200,7 @@ public GalleryImageProperties withIdentifier(GalleryImageIdentifier identifier) /** * 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() { @@ -211,7 +210,7 @@ public GalleryImageVersion 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. */ @@ -222,7 +221,7 @@ public GalleryImageProperties withVersion(GalleryImageVersion version) { /** * Get the provisioningState property: Provisioning state of the gallery image. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -231,7 +230,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of gallery images. - * + * * @return the status value. */ public GalleryImageStatus status() { @@ -240,14 +239,13 @@ public GalleryImageStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (osType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property osType in model GalleryImageProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property osType in model GalleryImageProperties")); } if (identifier() != null) { identifier().validate(); @@ -261,4 +259,68 @@ public void 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 index ad1b2ef34f2a..a22bd19d6190 100644 --- 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 @@ -6,25 +6,32 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Describes the properties of a gallery image version. */ +/** + * Describes the properties of a gallery image version. + */ @Fluent -public final class GalleryImageVersionProperties { +public final class GalleryImageVersionProperties implements JsonSerializable { /* * This is the storage profile of a Gallery Image Version. */ - @JsonProperty(value = "storageProfile", required = true) private GalleryImageVersionStorageProfile storageProfile; - /** Creates an instance of GalleryImageVersionProperties class. */ + /** + * 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() { @@ -33,7 +40,7 @@ public GalleryImageVersionStorageProfile 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. */ @@ -44,19 +51,57 @@ public GalleryImageVersionProperties withStorageProfile(GalleryImageVersionStora /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (storageProfile() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageProfile in model GalleryImageVersionProperties")); + 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 index 9e9bc65db83f..aece67927400 100644 --- 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 @@ -7,6 +7,9 @@ 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; @@ -15,37 +18,53 @@ import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The gallery images resource definition. */ +/** + * The gallery images resource definition. + */ @Fluent public final class GalleryImagesInner extends Resource { /* * Properties under the gallery image resource */ - @JsonProperty(value = "properties") private GalleryImageProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of GalleryImagesInner class. */ + /* + * 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; + + /** + * 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() { @@ -54,7 +73,7 @@ private GalleryImageProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -63,7 +82,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the GalleryImagesInner object itself. */ @@ -74,21 +93,55 @@ public GalleryImagesInner withExtendedLocation(ExtendedLocation extendedLocation /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public GalleryImagesInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public GalleryImagesInner withTags(Map tags) { super.withTags(tags); @@ -97,7 +150,7 @@ public GalleryImagesInner withTags(Map tags) { /** * Get the containerId property: Storage ContainerID of the storage container to be used for gallery image. - * + * * @return the containerId value. */ public String containerId() { @@ -106,7 +159,7 @@ public String 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. */ @@ -120,7 +173,7 @@ public GalleryImagesInner withContainerId(String containerId) { /** * Get the imagePath property: location of the image the gallery image should be created from. - * + * * @return the imagePath value. */ public String imagePath() { @@ -129,7 +182,7 @@ public String 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. */ @@ -143,7 +196,7 @@ public GalleryImagesInner withImagePath(String imagePath) { /** * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. - * + * * @return the osType value. */ public OperatingSystemTypes osType() { @@ -152,7 +205,7 @@ public OperatingSystemTypes 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. */ @@ -167,7 +220,7 @@ public GalleryImagesInner withOsType(OperatingSystemTypes osType) { /** * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init * [NoCloud, Azure]. - * + * * @return the cloudInitDataSource value. */ public CloudInitDataSource cloudInitDataSource() { @@ -177,7 +230,7 @@ public CloudInitDataSource 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. */ @@ -191,7 +244,7 @@ public GalleryImagesInner withCloudInitDataSource(CloudInitDataSource cloudInitD /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -200,7 +253,7 @@ public HyperVGeneration 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. */ @@ -214,7 +267,7 @@ public GalleryImagesInner withHyperVGeneration(HyperVGeneration hyperVGeneration /** * Get the identifier property: This is the gallery image definition identifier. - * + * * @return the identifier value. */ public GalleryImageIdentifier identifier() { @@ -223,7 +276,7 @@ public GalleryImageIdentifier identifier() { /** * Set the identifier property: This is the gallery image definition identifier. - * + * * @param identifier the identifier value to set. * @return the GalleryImagesInner object itself. */ @@ -238,7 +291,7 @@ public GalleryImagesInner withIdentifier(GalleryImageIdentifier identifier) { /** * 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() { @@ -248,7 +301,7 @@ public GalleryImageVersion 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. */ @@ -262,7 +315,7 @@ public GalleryImagesInner withVersion(GalleryImageVersion version) { /** * Get the provisioningState property: Provisioning state of the gallery image. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -271,7 +324,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of gallery images. - * + * * @return the status value. */ public GalleryImageStatus status() { @@ -280,7 +333,7 @@ public GalleryImageStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -291,4 +344,59 @@ public void validate() { 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 index 42e40d3bc07e..72c2b596dccd 100644 --- 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 @@ -8,32 +8,52 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Defines the GuestAgent. */ +/** + * Defines the GuestAgent. + */ @Fluent public final class GuestAgentInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties", required = true) private GuestAgentProperties innerProperties = new GuestAgentProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of GuestAgentInner class. */ + /* + * 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; + + /** + * Creates an instance of GuestAgentInner class. + */ public GuestAgentInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private GuestAgentProperties innerProperties() { @@ -42,16 +62,46 @@ private GuestAgentProperties 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 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 credentials property: Username / Password Credentials to provision guest agent. - * + * * @return the credentials value. */ public GuestCredential credentials() { @@ -60,7 +110,7 @@ public GuestCredential credentials() { /** * Set the credentials property: Username / Password Credentials to provision guest agent. - * + * * @param credentials the credentials value to set. * @return the GuestAgentInner object itself. */ @@ -74,7 +124,7 @@ public GuestAgentInner withCredentials(GuestCredential credentials) { /** * Get the provisioningAction property: The guest agent provisioning action. - * + * * @return the provisioningAction value. */ public ProvisioningAction provisioningAction() { @@ -83,7 +133,7 @@ public ProvisioningAction provisioningAction() { /** * Set the provisioningAction property: The guest agent provisioning action. - * + * * @param provisioningAction the provisioningAction value to set. * @return the GuestAgentInner object itself. */ @@ -97,7 +147,7 @@ public GuestAgentInner withProvisioningAction(ProvisioningAction provisioningAct /** * Get the status property: The guest agent status. - * + * * @return the status value. */ public String status() { @@ -106,7 +156,7 @@ public String status() { /** * Get the provisioningState property: The provisioning state. - * + * * @return the provisioningState value. */ public String provisioningState() { @@ -115,13 +165,13 @@ public String provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property innerProperties in model GuestAgentInner")); } else { innerProperties().validate(); @@ -129,4 +179,49 @@ public void 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 index 84da616d738c..c3018aa95d92 100644 --- 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 @@ -5,44 +5,48 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent -public final class GuestAgentProperties { +public final class GuestAgentProperties implements JsonSerializable { /* * Username / Password Credentials to provision guest agent. */ - @JsonProperty(value = "credentials") private GuestCredential credentials; /* * The guest agent provisioning action. */ - @JsonProperty(value = "provisioningAction") private ProvisioningAction provisioningAction; /* * The guest agent status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; /* * The provisioning state. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; - /** Creates an instance of GuestAgentProperties class. */ + /** + * 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() { @@ -51,7 +55,7 @@ public GuestCredential credentials() { /** * Set the credentials property: Username / Password Credentials to provision guest agent. - * + * * @param credentials the credentials value to set. * @return the GuestAgentProperties object itself. */ @@ -62,7 +66,7 @@ public GuestAgentProperties withCredentials(GuestCredential credentials) { /** * Get the provisioningAction property: The guest agent provisioning action. - * + * * @return the provisioningAction value. */ public ProvisioningAction provisioningAction() { @@ -71,7 +75,7 @@ public ProvisioningAction provisioningAction() { /** * Set the provisioningAction property: The guest agent provisioning action. - * + * * @param provisioningAction the provisioningAction value to set. * @return the GuestAgentProperties object itself. */ @@ -82,7 +86,7 @@ public GuestAgentProperties withProvisioningAction(ProvisioningAction provisioni /** * Get the status property: The guest agent status. - * + * * @return the status value. */ public String status() { @@ -91,7 +95,7 @@ public String status() { /** * Get the provisioningState property: The provisioning state. - * + * * @return the provisioningState value. */ public String provisioningState() { @@ -100,7 +104,7 @@ public String provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -108,4 +112,49 @@ public void validate() { 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 new file mode 100644 index 000000000000..08068a05e8f0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java @@ -0,0 +1,675 @@ +// Copyright (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.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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Update details. + */ +@Fluent +public final class HciUpdateInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Update properties + */ + private UpdateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of HciUpdateInner class. + */ + public HciUpdateInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update properties. + * + * @return the innerProperties value. + */ + private UpdateProperties 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 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 provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.innerProperties() == null ? null : this.innerProperties().installedDate(); + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withInstalledDate(OffsetDateTime installedDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withInstalledDate(installedDate); + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withState(State state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.innerProperties() == null ? null : this.innerProperties().prerequisites(); + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPrerequisites(List prerequisites) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPrerequisites(prerequisites); + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.innerProperties() == null ? null : this.innerProperties().componentVersions(); + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withComponentVersions(List componentVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withComponentVersions(componentVersions); + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.innerProperties() == null ? null : this.innerProperties().rebootRequired(); + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withRebootRequired(RebootRequirement rebootRequired) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withRebootRequired(rebootRequired); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.innerProperties() == null ? null : this.innerProperties().packagePath(); + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackagePath(String packagePath) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackagePath(packagePath); + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.innerProperties() == null ? null : this.innerProperties().packageSizeInMb(); + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackageSizeInMb(Float packageSizeInMb) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageSizeInMb(packageSizeInMb); + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.innerProperties() == null ? null : this.innerProperties().releaseLink(); + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withReleaseLink(String releaseLink) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withReleaseLink(releaseLink); + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityType(); + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withAvailabilityType(AvailabilityType availabilityType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAvailabilityType(availabilityType); + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.innerProperties() == null ? null : this.innerProperties().packageType(); + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackageType(String packageType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageType(packageType); + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.innerProperties() == null ? null : this.innerProperties().additionalProperties(); + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withAdditionalProperties(String additionalProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAdditionalProperties(additionalProperties); + return this; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerProperties() == null ? null : this.innerProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withProgressPercentage(Float progressPercentage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerProperties() == null ? null : this.innerProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withNotifyMessage(String notifyMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withNotifyMessage(notifyMessage); + 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("location", this.location); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HciUpdateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HciUpdateInner 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 HciUpdateInner. + */ + public static HciUpdateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HciUpdateInner deserializedHciUpdateInner = new HciUpdateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHciUpdateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHciUpdateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHciUpdateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHciUpdateInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHciUpdateInner.innerProperties = UpdateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHciUpdateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHciUpdateInner; + }); + } +} 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 index 58294778c682..71f992a67864 100644 --- 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 @@ -8,31 +8,51 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Defines the HybridIdentityMetadata. */ +/** + * Defines the HybridIdentityMetadata. + */ @Fluent public final class HybridIdentityMetadataInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties", required = true) private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of HybridIdentityMetadataInner class. */ + /* + * 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; + + /** + * Creates an instance of HybridIdentityMetadataInner class. + */ public HybridIdentityMetadataInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private HybridIdentityMetadataProperties innerProperties() { @@ -41,16 +61,46 @@ private HybridIdentityMetadataProperties 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 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 resourceUid property: The unique identifier for the resource. - * + * * @return the resourceUid value. */ public String resourceUid() { @@ -59,7 +109,7 @@ public String resourceUid() { /** * Set the resourceUid property: The unique identifier for the resource. - * + * * @param resourceUid the resourceUid value to set. * @return the HybridIdentityMetadataInner object itself. */ @@ -73,7 +123,7 @@ public HybridIdentityMetadataInner withResourceUid(String resourceUid) { /** * Get the publicKey property: The Public Key. - * + * * @return the publicKey value. */ public String publicKey() { @@ -82,7 +132,7 @@ public String publicKey() { /** * Set the publicKey property: The Public Key. - * + * * @param publicKey the publicKey value to set. * @return the HybridIdentityMetadataInner object itself. */ @@ -96,7 +146,7 @@ public HybridIdentityMetadataInner withPublicKey(String publicKey) { /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -105,7 +155,7 @@ public Identity identity() { /** * Get the provisioningState property: The provisioning state. - * + * * @return the provisioningState value. */ public String provisioningState() { @@ -114,19 +164,64 @@ public String provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model HybridIdentityMetadataInner")); + 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 index ed37a83a47fe..3b1900099357 100644 --- 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 @@ -5,43 +5,47 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent -public final class HybridIdentityMetadataProperties { +public final class HybridIdentityMetadataProperties implements JsonSerializable { /* * The unique identifier for the resource. */ - @JsonProperty(value = "resourceUid") private String resourceUid; /* * The Public Key. */ - @JsonProperty(value = "publicKey") private String publicKey; /* * Identity for the resource. */ - @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) private Identity identity; /* * The provisioning state. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; - /** Creates an instance of HybridIdentityMetadataProperties class. */ + /** + * 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() { @@ -50,7 +54,7 @@ public String resourceUid() { /** * Set the resourceUid property: The unique identifier for the resource. - * + * * @param resourceUid the resourceUid value to set. * @return the HybridIdentityMetadataProperties object itself. */ @@ -61,7 +65,7 @@ public HybridIdentityMetadataProperties withResourceUid(String resourceUid) { /** * Get the publicKey property: The Public Key. - * + * * @return the publicKey value. */ public String publicKey() { @@ -70,7 +74,7 @@ public String publicKey() { /** * Set the publicKey property: The Public Key. - * + * * @param publicKey the publicKey value to set. * @return the HybridIdentityMetadataProperties object itself. */ @@ -81,7 +85,7 @@ public HybridIdentityMetadataProperties withPublicKey(String publicKey) { /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -90,7 +94,7 @@ public Identity identity() { /** * Get the provisioningState property: The provisioning state. - * + * * @return the provisioningState value. */ public String provisioningState() { @@ -99,7 +103,7 @@ public String provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -107,4 +111,48 @@ public void validate() { 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 index 6c4ecb6cd4bf..5b55ca8c4e13 100644 --- 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 @@ -5,55 +5,58 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Properties under the logical network resource. */ +/** + * Properties under the logical network resource. + */ @Fluent -public final class LogicalNetworkProperties { +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. */ - @JsonProperty(value = "dhcpOptions") private LogicalNetworkPropertiesDhcpOptions dhcpOptions; /* * Subnet - list of subnets under the logical network */ - @JsonProperty(value = "subnets") private List subnets; /* * Provisioning state of the logical network. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * name of the network switch to be used for VMs */ - @JsonProperty(value = "vmSwitchName") private String vmSwitchName; /* * The observed state of logical networks */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private LogicalNetworkStatus status; - /** Creates an instance of LogicalNetworkProperties class. */ + /** + * 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() { @@ -63,7 +66,7 @@ public LogicalNetworkPropertiesDhcpOptions 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. */ @@ -74,7 +77,7 @@ public LogicalNetworkProperties withDhcpOptions(LogicalNetworkPropertiesDhcpOpti /** * Get the subnets property: Subnet - list of subnets under the logical network. - * + * * @return the subnets value. */ public List subnets() { @@ -83,7 +86,7 @@ public List 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. */ @@ -94,7 +97,7 @@ public LogicalNetworkProperties withSubnets(List subnets) { /** * Get the provisioningState property: Provisioning state of the logical network. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -103,7 +106,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the vmSwitchName property: name of the network switch to be used for VMs. - * + * * @return the vmSwitchName value. */ public String vmSwitchName() { @@ -112,7 +115,7 @@ public String 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. */ @@ -123,7 +126,7 @@ public LogicalNetworkProperties withVmSwitchName(String vmSwitchName) { /** * Get the status property: The observed state of logical networks. - * + * * @return the status value. */ public LogicalNetworkStatus status() { @@ -132,7 +135,7 @@ public LogicalNetworkStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -146,4 +149,53 @@ public void validate() { 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 index 906d409fb022..7eed709fb332 100644 --- 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 @@ -7,43 +7,62 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** The logical network resource definition. */ +/** + * The logical network resource definition. + */ @Fluent public final class LogicalNetworksInner extends Resource { /* * Properties under the logical network resource */ - @JsonProperty(value = "properties") private LogicalNetworkProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of LogicalNetworksInner class. */ + /* + * 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; + + /** + * 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() { @@ -52,7 +71,7 @@ private LogicalNetworkProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,7 +80,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the LogicalNetworksInner object itself. */ @@ -72,21 +91,55 @@ public LogicalNetworksInner withExtendedLocation(ExtendedLocation extendedLocati /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public LogicalNetworksInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public LogicalNetworksInner withTags(Map tags) { super.withTags(tags); @@ -96,7 +149,7 @@ public LogicalNetworksInner withTags(Map tags) { /** * 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() { @@ -106,7 +159,7 @@ public LogicalNetworkPropertiesDhcpOptions 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. */ @@ -120,7 +173,7 @@ public LogicalNetworksInner withDhcpOptions(LogicalNetworkPropertiesDhcpOptions /** * Get the subnets property: Subnet - list of subnets under the logical network. - * + * * @return the subnets value. */ public List subnets() { @@ -129,7 +182,7 @@ public List 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. */ @@ -143,7 +196,7 @@ public LogicalNetworksInner withSubnets(List subnets) { /** * Get the provisioningState property: Provisioning state of the logical network. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -152,7 +205,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the vmSwitchName property: name of the network switch to be used for VMs. - * + * * @return the vmSwitchName value. */ public String vmSwitchName() { @@ -161,7 +214,7 @@ public String 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. */ @@ -175,7 +228,7 @@ public LogicalNetworksInner withVmSwitchName(String vmSwitchName) { /** * Get the status property: The observed state of logical networks. - * + * * @return the status value. */ public LogicalNetworkStatus status() { @@ -184,7 +237,7 @@ public LogicalNetworkStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -195,4 +248,59 @@ public void validate() { 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/ManagedServiceIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..c659c603f23b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java @@ -0,0 +1,192 @@ +// Copyright (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.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} 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 index 846c79e02b09..ec68fa2c4182 100644 --- 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 @@ -6,6 +6,10 @@ 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; @@ -13,67 +17,63 @@ import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties under the marketplace gallery image resource. */ +/** + * Properties under the marketplace gallery image resource. + */ @Fluent -public final class MarketplaceGalleryImageProperties { +public final class MarketplaceGalleryImageProperties implements JsonSerializable { /* * Storage ContainerID of the storage container to be used for marketplace gallery image */ - @JsonProperty(value = "containerId") private String containerId; /* * Operating system type that the gallery image uses [Windows, Linux] */ - @JsonProperty(value = "osType", required = true) private OperatingSystemTypes osType; /* * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] */ - @JsonProperty(value = "cloudInitDataSource") private CloudInitDataSource cloudInitDataSource; /* * The hypervisor generation of the Virtual Machine [V1, V2] */ - @JsonProperty(value = "hyperVGeneration") private HyperVGeneration hyperVGeneration; /* * This is the gallery image definition identifier. */ - @JsonProperty(value = "identifier") private GalleryImageIdentifier identifier; /* * Specifies information about the gallery image version that you want to create or update. */ - @JsonProperty(value = "version") private GalleryImageVersion version; /* * Provisioning state of the marketplace gallery image. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * The observed state of marketplace gallery images */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private MarketplaceGalleryImageStatus status; - /** Creates an instance of MarketplaceGalleryImageProperties class. */ + /** + * 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() { @@ -83,7 +83,7 @@ public String 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. */ @@ -94,7 +94,7 @@ public MarketplaceGalleryImageProperties withContainerId(String containerId) { /** * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. - * + * * @return the osType value. */ public OperatingSystemTypes osType() { @@ -103,7 +103,7 @@ public OperatingSystemTypes 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. */ @@ -115,7 +115,7 @@ public MarketplaceGalleryImageProperties withOsType(OperatingSystemTypes osType) /** * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init * [NoCloud, Azure]. - * + * * @return the cloudInitDataSource value. */ public CloudInitDataSource cloudInitDataSource() { @@ -125,7 +125,7 @@ public CloudInitDataSource 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. */ @@ -136,7 +136,7 @@ public MarketplaceGalleryImageProperties withCloudInitDataSource(CloudInitDataSo /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -145,7 +145,7 @@ public HyperVGeneration 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. */ @@ -156,7 +156,7 @@ public MarketplaceGalleryImageProperties withHyperVGeneration(HyperVGeneration h /** * Get the identifier property: This is the gallery image definition identifier. - * + * * @return the identifier value. */ public GalleryImageIdentifier identifier() { @@ -165,7 +165,7 @@ public GalleryImageIdentifier identifier() { /** * Set the identifier property: This is the gallery image definition identifier. - * + * * @param identifier the identifier value to set. * @return the MarketplaceGalleryImageProperties object itself. */ @@ -177,7 +177,7 @@ public MarketplaceGalleryImageProperties withIdentifier(GalleryImageIdentifier i /** * 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() { @@ -187,7 +187,7 @@ public GalleryImageVersion 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. */ @@ -198,7 +198,7 @@ public MarketplaceGalleryImageProperties withVersion(GalleryImageVersion version /** * Get the provisioningState property: Provisioning state of the marketplace gallery image. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -207,7 +207,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of marketplace gallery images. - * + * * @return the status value. */ public MarketplaceGalleryImageStatus status() { @@ -216,15 +216,14 @@ public MarketplaceGalleryImageStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (osType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property osType in model MarketplaceGalleryImageProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property osType in model MarketplaceGalleryImageProperties")); } if (identifier() != null) { identifier().validate(); @@ -238,4 +237,68 @@ public void 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 index f3e6159a5c30..554dd064e782 100644 --- 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 @@ -7,6 +7,9 @@ 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; @@ -15,37 +18,53 @@ import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The marketplace gallery image resource definition. */ +/** + * The marketplace gallery image resource definition. + */ @Fluent public final class MarketplaceGalleryImagesInner extends Resource { /* * Properties under the marketplace gallery image resource */ - @JsonProperty(value = "properties") private MarketplaceGalleryImageProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of MarketplaceGalleryImagesInner class. */ + /* + * 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; + + /** + * 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() { @@ -54,7 +73,7 @@ private MarketplaceGalleryImageProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -63,7 +82,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the MarketplaceGalleryImagesInner object itself. */ @@ -74,21 +93,55 @@ public MarketplaceGalleryImagesInner withExtendedLocation(ExtendedLocation exten /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public MarketplaceGalleryImagesInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MarketplaceGalleryImagesInner withTags(Map tags) { super.withTags(tags); @@ -98,7 +151,7 @@ public MarketplaceGalleryImagesInner withTags(Map tags) { /** * Get the containerId property: Storage ContainerID of the storage container to be used for marketplace gallery * image. - * + * * @return the containerId value. */ public String containerId() { @@ -108,7 +161,7 @@ public String 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. */ @@ -122,7 +175,7 @@ public MarketplaceGalleryImagesInner withContainerId(String containerId) { /** * Get the osType property: Operating system type that the gallery image uses [Windows, Linux]. - * + * * @return the osType value. */ public OperatingSystemTypes osType() { @@ -131,7 +184,7 @@ public OperatingSystemTypes 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. */ @@ -146,7 +199,7 @@ public MarketplaceGalleryImagesInner withOsType(OperatingSystemTypes osType) { /** * Get the cloudInitDataSource property: Datasource for the gallery image when provisioning with cloud-init * [NoCloud, Azure]. - * + * * @return the cloudInitDataSource value. */ public CloudInitDataSource cloudInitDataSource() { @@ -156,7 +209,7 @@ public CloudInitDataSource 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. */ @@ -170,7 +223,7 @@ public MarketplaceGalleryImagesInner withCloudInitDataSource(CloudInitDataSource /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -179,7 +232,7 @@ public HyperVGeneration 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. */ @@ -193,7 +246,7 @@ public MarketplaceGalleryImagesInner withHyperVGeneration(HyperVGeneration hyper /** * Get the identifier property: This is the gallery image definition identifier. - * + * * @return the identifier value. */ public GalleryImageIdentifier identifier() { @@ -202,7 +255,7 @@ public GalleryImageIdentifier identifier() { /** * Set the identifier property: This is the gallery image definition identifier. - * + * * @param identifier the identifier value to set. * @return the MarketplaceGalleryImagesInner object itself. */ @@ -217,7 +270,7 @@ public MarketplaceGalleryImagesInner withIdentifier(GalleryImageIdentifier ident /** * 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() { @@ -227,7 +280,7 @@ public GalleryImageVersion 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. */ @@ -241,7 +294,7 @@ public MarketplaceGalleryImagesInner withVersion(GalleryImageVersion version) { /** * Get the provisioningState property: Provisioning state of the marketplace gallery image. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -250,7 +303,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of marketplace gallery images. - * + * * @return the status value. */ public MarketplaceGalleryImageStatus status() { @@ -259,7 +312,7 @@ public MarketplaceGalleryImageStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -270,4 +323,61 @@ public void validate() { 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 index f15bd4eed24e..bc6f320e2237 100644 --- 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 @@ -5,53 +5,56 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Properties under the network interface resource. */ +/** + * Properties under the network interface resource. + */ @Fluent -public final class NetworkInterfaceProperties { +public final class NetworkInterfaceProperties implements JsonSerializable { /* * IPConfigurations - A list of IPConfigurations of the network interface. */ - @JsonProperty(value = "ipConfigurations") private List ipConfigurations; /* * MacAddress - The MAC address of the network interface. */ - @JsonProperty(value = "macAddress") private String macAddress; /* * DNS Settings for the interface */ - @JsonProperty(value = "dnsSettings") private InterfaceDnsSettings dnsSettings; /* * Provisioning state of the network interface. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * The observed state of network interfaces */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private NetworkInterfaceStatus status; - /** Creates an instance of NetworkInterfaceProperties class. */ + /** + * 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() { @@ -60,7 +63,7 @@ public List 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. */ @@ -71,7 +74,7 @@ public NetworkInterfaceProperties withIpConfigurations(List ipC /** * Get the macAddress property: MacAddress - The MAC address of the network interface. - * + * * @return the macAddress value. */ public String macAddress() { @@ -80,7 +83,7 @@ public String 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. */ @@ -91,7 +94,7 @@ public NetworkInterfaceProperties withMacAddress(String macAddress) { /** * Get the dnsSettings property: DNS Settings for the interface. - * + * * @return the dnsSettings value. */ public InterfaceDnsSettings dnsSettings() { @@ -100,7 +103,7 @@ public InterfaceDnsSettings dnsSettings() { /** * Set the dnsSettings property: DNS Settings for the interface. - * + * * @param dnsSettings the dnsSettings value to set. * @return the NetworkInterfaceProperties object itself. */ @@ -111,7 +114,7 @@ public NetworkInterfaceProperties withDnsSettings(InterfaceDnsSettings dnsSettin /** * Get the provisioningState property: Provisioning state of the network interface. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -120,7 +123,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of network interfaces. - * + * * @return the status value. */ public NetworkInterfaceStatus status() { @@ -129,7 +132,7 @@ public NetworkInterfaceStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -143,4 +146,54 @@ public void validate() { 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 index e504f8292c41..2193b5335ad7 100644 --- 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 @@ -7,43 +7,62 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** The network interface resource definition. */ +/** + * The network interface resource definition. + */ @Fluent public final class NetworkInterfacesInner extends Resource { /* * Properties under the network interface resource */ - @JsonProperty(value = "properties") private NetworkInterfaceProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of NetworkInterfacesInner class. */ + /* + * 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; + + /** + * 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() { @@ -52,7 +71,7 @@ private NetworkInterfaceProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,7 +80,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the NetworkInterfacesInner object itself. */ @@ -72,21 +91,55 @@ public NetworkInterfacesInner withExtendedLocation(ExtendedLocation extendedLoca /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public NetworkInterfacesInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NetworkInterfacesInner withTags(Map tags) { super.withTags(tags); @@ -95,7 +148,7 @@ public NetworkInterfacesInner withTags(Map tags) { /** * Get the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. - * + * * @return the ipConfigurations value. */ public List ipConfigurations() { @@ -104,7 +157,7 @@ public List 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. */ @@ -118,7 +171,7 @@ public NetworkInterfacesInner withIpConfigurations(List ipConfi /** * Get the macAddress property: MacAddress - The MAC address of the network interface. - * + * * @return the macAddress value. */ public String macAddress() { @@ -127,7 +180,7 @@ public String 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. */ @@ -141,7 +194,7 @@ public NetworkInterfacesInner withMacAddress(String macAddress) { /** * Get the dnsSettings property: DNS Settings for the interface. - * + * * @return the dnsSettings value. */ public InterfaceDnsSettings dnsSettings() { @@ -150,7 +203,7 @@ public InterfaceDnsSettings dnsSettings() { /** * Set the dnsSettings property: DNS Settings for the interface. - * + * * @param dnsSettings the dnsSettings value to set. * @return the NetworkInterfacesInner object itself. */ @@ -164,7 +217,7 @@ public NetworkInterfacesInner withDnsSettings(InterfaceDnsSettings dnsSettings) /** * Get the provisioningState property: Provisioning state of the network interface. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -173,7 +226,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of network interfaces. - * + * * @return the status value. */ public NetworkInterfaceStatus status() { @@ -182,7 +235,7 @@ public NetworkInterfaceStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -193,4 +246,59 @@ public void validate() { 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 new file mode 100644 index 000000000000..08f059d0778d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java @@ -0,0 +1,257 @@ +// Copyright (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.SkuMappings; +import java.io.IOException; +import java.util.List; + +/** + * Offer details. + */ +@Fluent +public final class OfferInner extends ProxyResource { + /* + * Offer properties. + */ + private OfferProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of OfferInner class. + */ + public OfferInner() { + } + + /** + * Get the innerProperties property: Offer properties. + * + * @return the innerProperties value. + */ + private OfferProperties 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 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 provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferInner object itself. + */ + public OfferInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferInner object itself. + */ + public OfferInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + 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 OfferInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfferInner 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 OfferInner. + */ + public static OfferInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfferInner deserializedOfferInner = new OfferInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOfferInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOfferInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOfferInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOfferInner.innerProperties = OfferProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOfferInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfferInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java new file mode 100644 index 000000000000..470593b2b7df --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.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.SkuMappings; +import java.io.IOException; +import java.util.List; + +/** + * Publisher properties. + */ +@Fluent +public final class OfferProperties implements JsonSerializable { + /* + * Provisioning State + */ + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + private String publisherId; + + /* + * JSON serialized catalog content of the offer + */ + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + private String contentVersion; + + /* + * Array of SKU mappings + */ + private List skuMappings; + + /** + * Creates an instance of OfferProperties class. + */ + public OfferProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("contentVersion", this.contentVersion); + jsonWriter.writeArrayField("skuMappings", this.skuMappings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfferProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfferProperties 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 OfferProperties. + */ + public static OfferProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfferProperties deserializedOfferProperties = new OfferProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedOfferProperties.provisioningState = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedOfferProperties.publisherId = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedOfferProperties.content = reader.getString(); + } else if ("contentVersion".equals(fieldName)) { + deserializedOfferProperties.contentVersion = reader.getString(); + } else if ("skuMappings".equals(fieldName)) { + List skuMappings = reader.readArray(reader1 -> SkuMappings.fromJson(reader1)); + deserializedOfferProperties.skuMappings = skuMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedOfferProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationInner.java deleted file mode 100644 index bae278555ce0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationInner.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.azurestackhci.models.ActionType; -import com.azure.resourcemanager.azurestackhci.models.OperationDisplay; -import com.azure.resourcemanager.azurestackhci.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Fluent -public final class OperationInner { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) - private ActionType actionType; - - /** Creates an instance of OperationInner class. */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java new file mode 100644 index 000000000000..65eede5f63b2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResultInner implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResultInner class. + */ + public OperationListResultInner() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResultInner 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 OperationListResultInner. + */ + public static OperationListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResultInner deserializedOperationListResultInner = new OperationListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Operation.fromJson(reader1)); + deserializedOperationListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResultInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java new file mode 100644 index 000000000000..56d65c3fd923 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java @@ -0,0 +1,184 @@ +// Copyright (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.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; + +/** + * The PasswordCredential model. + */ +@Fluent +public final class PasswordCredentialInner implements JsonSerializable { + /* + * The secretText property. + */ + private String secretText; + + /* + * The keyId property. + */ + private String keyId; + + /* + * The startDateTime property. + */ + private OffsetDateTime startDateTime; + + /* + * The endDateTime property. + */ + private OffsetDateTime endDateTime; + + /** + * Creates an instance of PasswordCredentialInner class. + */ + public PasswordCredentialInner() { + } + + /** + * Get the secretText property: The secretText property. + * + * @return the secretText value. + */ + public String secretText() { + return this.secretText; + } + + /** + * Set the secretText property: The secretText property. + * + * @param secretText the secretText value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withSecretText(String secretText) { + this.secretText = secretText; + return this; + } + + /** + * Get the keyId property: The keyId property. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: The keyId property. + * + * @param keyId the keyId value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The startDateTime property. + * + * @param startDateTime the startDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The endDateTime property. + * + * @param endDateTime the endDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretText", this.secretText); + jsonWriter.writeStringField("keyId", this.keyId); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PasswordCredentialInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PasswordCredentialInner 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 PasswordCredentialInner. + */ + public static PasswordCredentialInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PasswordCredentialInner deserializedPasswordCredentialInner = new PasswordCredentialInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretText".equals(fieldName)) { + deserializedPasswordCredentialInner.secretText = reader.getString(); + } else if ("keyId".equals(fieldName)) { + deserializedPasswordCredentialInner.keyId = reader.getString(); + } else if ("startDateTime".equals(fieldName)) { + deserializedPasswordCredentialInner.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + deserializedPasswordCredentialInner.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPasswordCredentialInner; + }); + } +} 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 new file mode 100644 index 000000000000..90b19e0bec07 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.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 java.io.IOException; + +/** + * Publisher details. + */ +@Immutable +public final class PublisherInner extends ProxyResource { + /* + * Publisher properties. + */ + private PublisherProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of PublisherInner class. + */ + public PublisherInner() { + } + + /** + * Get the innerProperties property: Publisher properties. + * + * @return the innerProperties value. + */ + private PublisherProperties 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 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 provisioningState property: 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) { + 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 PublisherInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublisherInner 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 PublisherInner. + */ + public static PublisherInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublisherInner deserializedPublisherInner = new PublisherInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPublisherInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPublisherInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPublisherInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPublisherInner.innerProperties = PublisherProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPublisherInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPublisherInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java new file mode 100644 index 000000000000..74dab509d810 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.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.fluent.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; + +/** + * Publisher properties. + */ +@Immutable +public final class PublisherProperties implements JsonSerializable { + /* + * Provisioning State + */ + private String provisioningState; + + /** + * Creates an instance of PublisherProperties class. + */ + public PublisherProperties() { + } + + /** + * Get the provisioningState property: 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublisherProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublisherProperties 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 PublisherProperties. + */ + public static PublisherProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublisherProperties deserializedPublisherProperties = new PublisherProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedPublisherProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublisherProperties; + }); + } +} 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 index 69003032257a..f2cb512ff8d2 100644 --- 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 @@ -5,31 +5,37 @@ package com.azure.resourcemanager.azurestackhci.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * RoutePropertiesFormat - Route resource. + */ @Fluent -public final class RoutePropertiesFormat { +public final class RoutePropertiesFormat implements JsonSerializable { /* * The destination CIDR to which the route applies. */ - @JsonProperty(value = "addressPrefix") 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. + * The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type + * is VirtualAppliance. */ - @JsonProperty(value = "nextHopIpAddress") private String nextHopIpAddress; - /** Creates an instance of RoutePropertiesFormat class. */ + /** + * 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() { @@ -38,7 +44,7 @@ public String 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. */ @@ -50,7 +56,7 @@ public RoutePropertiesFormat withAddressPrefix(String addressPrefix) { /** * 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() { @@ -60,7 +66,7 @@ public String 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. */ @@ -71,9 +77,48 @@ public RoutePropertiesFormat withNextHopIpAddress(String nextHopIpAddress) { /** * 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 index b75df727cdea..4b3845255acb 100644 --- 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 @@ -5,26 +5,33 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** RouteTablePropertiesFormat - Route Table resource. */ +/** + * RouteTablePropertiesFormat - Route Table resource. + */ @Fluent -public final class RouteTablePropertiesFormat { +public final class RouteTablePropertiesFormat implements JsonSerializable { /* * Collection of routes contained within a route table. */ - @JsonProperty(value = "routes") private List routes; - /** Creates an instance of RouteTablePropertiesFormat class. */ + /** + * 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() { @@ -33,7 +40,7 @@ public List 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. */ @@ -44,7 +51,7 @@ public RouteTablePropertiesFormat withRoutes(List routes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -52,4 +59,41 @@ public void validate() { 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 new file mode 100644 index 000000000000..92e4063cb80d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecurityProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SecurityComplianceStatus; +import java.io.IOException; + +/** + * Security properties of the resource. + */ +@Fluent +public final class SecurityProperties implements JsonSerializable { + /* + * Secured Core Compliance Assignment + */ + private ComplianceAssignmentType securedCoreComplianceAssignment; + + /* + * Security Compliance Status + */ + private SecurityComplianceStatus securityComplianceStatus; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SecurityProperties class. + */ + public SecurityProperties() { + } + + /** + * Get the securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @return the securedCoreComplianceAssignment value. + */ + public ComplianceAssignmentType securedCoreComplianceAssignment() { + return this.securedCoreComplianceAssignment; + } + + /** + * Set the securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @param securedCoreComplianceAssignment the securedCoreComplianceAssignment value to set. + * @return the SecurityProperties object itself. + */ + public SecurityProperties + withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment) { + this.securedCoreComplianceAssignment = securedCoreComplianceAssignment; + return this; + } + + /** + * Get the securityComplianceStatus property: Security Compliance Status. + * + * @return the securityComplianceStatus value. + */ + public SecurityComplianceStatus securityComplianceStatus() { + return this.securityComplianceStatus; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The status of the last operation. + * + * @param provisioningState the provisioningState value to set. + * @return the SecurityProperties object itself. + */ + public SecurityProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityComplianceStatus() != null) { + securityComplianceStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securedCoreComplianceAssignment", + this.securedCoreComplianceAssignment == null ? null : this.securedCoreComplianceAssignment.toString()); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityProperties 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 SecurityProperties. + */ + public static SecurityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityProperties deserializedSecurityProperties = new SecurityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securedCoreComplianceAssignment".equals(fieldName)) { + deserializedSecurityProperties.securedCoreComplianceAssignment + = ComplianceAssignmentType.fromString(reader.getString()); + } else if ("securityComplianceStatus".equals(fieldName)) { + deserializedSecurityProperties.securityComplianceStatus = SecurityComplianceStatus.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecuritySettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecuritySettingInner.java new file mode 100644 index 000000000000..a81f0985d3b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SecuritySettingInner.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.ComplianceAssignmentType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SecurityComplianceStatus; +import java.io.IOException; + +/** + * Security settings proxy resource. + */ +@Fluent +public final class SecuritySettingInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SecurityProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of SecuritySettingInner class. + */ + public SecuritySettingInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private SecurityProperties 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 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 securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @return the securedCoreComplianceAssignment value. + */ + public ComplianceAssignmentType securedCoreComplianceAssignment() { + return this.innerProperties() == null ? null : this.innerProperties().securedCoreComplianceAssignment(); + } + + /** + * Set the securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @param securedCoreComplianceAssignment the securedCoreComplianceAssignment value to set. + * @return the SecuritySettingInner object itself. + */ + public SecuritySettingInner + withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityProperties(); + } + this.innerProperties().withSecuredCoreComplianceAssignment(securedCoreComplianceAssignment); + return this; + } + + /** + * Get the securityComplianceStatus property: Security Compliance Status. + * + * @return the securityComplianceStatus value. + */ + public SecurityComplianceStatus securityComplianceStatus() { + return this.innerProperties() == null ? null : this.innerProperties().securityComplianceStatus(); + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The status of the last operation. + * + * @param provisioningState the provisioningState value to set. + * @return the SecuritySettingInner object itself. + */ + public SecuritySettingInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + 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 SecuritySettingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecuritySettingInner 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 SecuritySettingInner. + */ + public static SecuritySettingInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecuritySettingInner deserializedSecuritySettingInner = new SecuritySettingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecuritySettingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecuritySettingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecuritySettingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecuritySettingInner.innerProperties = SecurityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecuritySettingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecuritySettingInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java new file mode 100644 index 000000000000..77c643002986 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.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.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.SkuMappings; +import java.io.IOException; +import java.util.List; + +/** + * Sku details. + */ +@Fluent +public final class SkuInner extends ProxyResource { + /* + * SKU properties. + */ + private SkuProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of SkuInner class. + */ + public SkuInner() { + } + + /** + * Get the innerProperties property: SKU properties. + * + * @return the innerProperties value. + */ + private SkuProperties 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 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 provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.innerProperties() == null ? null : this.innerProperties().offerId(); + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withOfferId(String offerId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withOfferId(offerId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuInner object itself. + */ + public SkuInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + 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 SkuInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuInner 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 SkuInner. + */ + public static SkuInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuInner deserializedSkuInner = new SkuInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSkuInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSkuInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSkuInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSkuInner.innerProperties = SkuProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSkuInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuInner; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java new file mode 100644 index 000000000000..b78c7cabda1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.io.IOException; +import java.util.List; + +/** + * SKU properties. + */ +@Fluent +public final class SkuProperties implements JsonSerializable { + /* + * Provisioning State + */ + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + private String publisherId; + + /* + * Identifier of the Offer for the sku + */ + private String offerId; + + /* + * JSON serialized catalog content of the sku offer + */ + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + private String contentVersion; + + /* + * Array of SKU mappings + */ + private List skuMappings; + + /** + * Creates an instance of SkuProperties class. + */ + public SkuProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("offerId", this.offerId); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("contentVersion", this.contentVersion); + jsonWriter.writeArrayField("skuMappings", this.skuMappings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuProperties 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 SkuProperties. + */ + public static SkuProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuProperties deserializedSkuProperties = new SkuProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSkuProperties.provisioningState = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedSkuProperties.publisherId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedSkuProperties.offerId = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedSkuProperties.content = reader.getString(); + } else if ("contentVersion".equals(fieldName)) { + deserializedSkuProperties.contentVersion = reader.getString(); + } else if ("skuMappings".equals(fieldName)) { + List skuMappings = reader.readArray(reader1 -> SkuMappings.fromJson(reader1)); + deserializedSkuProperties.skuMappings = skuMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java new file mode 100644 index 000000000000..3e70f45127f7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.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; +import java.util.List; + +/** + * Progress representation of the update run steps. + */ +@Fluent +public final class Step implements JsonSerializable { + /* + * Name of the step. + */ + private String name; + + /* + * More detailed description of the step. + */ + private String description; + + /* + * Error message, specified if the step is in a failed state. + */ + private String errorMessage; + + /* + * Status of the step, bubbled up from the ECE action plan for installation attempts. Values are: 'Success', + * 'Error', 'InProgress', and 'Unknown status'. + */ + private String status; + + /* + * When the step started, or empty if it has not started executing. + */ + private OffsetDateTime startTimeUtc; + + /* + * When the step reached a terminal state. + */ + private OffsetDateTime endTimeUtc; + + /* + * Completion time of this step or the last completed sub-step. + */ + private OffsetDateTime lastUpdatedTimeUtc; + + /* + * Recursive model for child steps of this step. + */ + private List steps; + + /** + * Creates an instance of Step class. + */ + public Step() { + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the Step object itself. + */ + public Step withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the Step object itself. + */ + public Step withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the Step object itself. + */ + public Step withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the Step object itself. + */ + public Step withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the Step object itself. + */ + public Step withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the Step object itself. + */ + public Step withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the Step object itself. + */ + public Step withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.lastUpdatedTimeUtc = lastUpdatedTimeUtc; + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.steps; + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the Step object itself. + */ + public Step withSteps(List steps) { + this.steps = steps; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("startTimeUtc", + this.startTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimeUtc)); + jsonWriter.writeStringField("endTimeUtc", + this.endTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTimeUtc)); + jsonWriter.writeStringField("lastUpdatedTimeUtc", + this.lastUpdatedTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTimeUtc)); + jsonWriter.writeArrayField("steps", this.steps, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Step from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Step 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 Step. + */ + public static Step fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Step deserializedStep = new Step(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStep.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedStep.description = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedStep.errorMessage = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedStep.status = reader.getString(); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedStep.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedStep.endTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedTimeUtc".equals(fieldName)) { + deserializedStep.lastUpdatedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("steps".equals(fieldName)) { + List steps = reader.readArray(reader1 -> Step.fromJson(reader1)); + deserializedStep.steps = steps; + } else { + reader.skipChildren(); + } + } + + return deserializedStep; + }); + } +} 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 index 2709e211ea70..13eee6d92d4b 100644 --- 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 @@ -6,38 +6,43 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties under the storage container resource. */ +/** + * Properties under the storage container resource. + */ @Fluent -public final class StorageContainerProperties { +public final class StorageContainerProperties implements JsonSerializable { /* * Path of the storage container on the disk */ - @JsonProperty(value = "path", required = true) private String path; /* * Provisioning state of the storage container. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * The observed state of storage containers */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private StorageContainerStatus status; - /** Creates an instance of StorageContainerProperties class. */ + /** + * 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() { @@ -46,7 +51,7 @@ public String 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. */ @@ -57,7 +62,7 @@ public StorageContainerProperties withPath(String path) { /** * Get the provisioningState property: Provisioning state of the storage container. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -66,7 +71,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of storage containers. - * + * * @return the status value. */ public StorageContainerStatus status() { @@ -75,13 +80,13 @@ public StorageContainerStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (path() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property path in model StorageContainerProperties")); } if (status() != null) { @@ -90,4 +95,46 @@ public void 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 index 046491d1e992..19389426dc36 100644 --- 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 @@ -7,40 +7,59 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The storage container resource definition. */ +/** + * The storage container resource definition. + */ @Fluent public final class StorageContainersInner extends Resource { /* * Properties under the storage container resource */ - @JsonProperty(value = "properties") private StorageContainerProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of StorageContainersInner class. */ + /* + * 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; + + /** + * 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() { @@ -49,7 +68,7 @@ private StorageContainerProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -58,7 +77,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the StorageContainersInner object itself. */ @@ -69,21 +88,55 @@ public StorageContainersInner withExtendedLocation(ExtendedLocation extendedLoca /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public StorageContainersInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public StorageContainersInner withTags(Map tags) { super.withTags(tags); @@ -92,7 +145,7 @@ public StorageContainersInner withTags(Map tags) { /** * Get the path property: Path of the storage container on the disk. - * + * * @return the path value. */ public String path() { @@ -101,7 +154,7 @@ public String 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. */ @@ -115,7 +168,7 @@ public StorageContainersInner withPath(String path) { /** * Get the provisioningState property: Provisioning state of the storage container. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -124,7 +177,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the status property: The observed state of storage containers. - * + * * @return the status value. */ public StorageContainerStatus status() { @@ -133,7 +186,7 @@ public StorageContainerStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -144,4 +197,59 @@ public void validate() { 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 index 24e133b286c6..cdb70a116a70 100644 --- 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 @@ -5,65 +5,66 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Properties of the subnet. */ +/** + * Properties of the subnet. + */ @Fluent -public final class SubnetPropertiesFormat { +public final class SubnetPropertiesFormat implements JsonSerializable { /* * The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. */ - @JsonProperty(value = "addressPrefix") private String addressPrefix; /* * List of address prefixes for the subnet. */ - @JsonProperty(value = "addressPrefixes") private List addressPrefixes; /* * IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' */ - @JsonProperty(value = "ipAllocationMethod") private IpAllocationMethodEnum ipAllocationMethod; /* * IPConfigurationReferences - list of IPConfigurationReferences */ - @JsonProperty(value = "ipConfigurationReferences") private List ipConfigurationReferences; /* * Route table resource. */ - @JsonProperty(value = "routeTable") private RouteTable routeTable; /* * network associated pool of IP Addresses */ - @JsonProperty(value = "ipPools") private List ipPools; /* * Vlan to use for the subnet */ - @JsonProperty(value = "vlan") private Integer vlan; - /** Creates an instance of SubnetPropertiesFormat class. */ + /** + * 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() { @@ -72,7 +73,7 @@ public String 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. */ @@ -83,7 +84,7 @@ public SubnetPropertiesFormat withAddressPrefix(String addressPrefix) { /** * Get the addressPrefixes property: List of address prefixes for the subnet. - * + * * @return the addressPrefixes value. */ public List addressPrefixes() { @@ -92,7 +93,7 @@ public List addressPrefixes() { /** * Set the addressPrefixes property: List of address prefixes for the subnet. - * + * * @param addressPrefixes the addressPrefixes value to set. * @return the SubnetPropertiesFormat object itself. */ @@ -104,7 +105,7 @@ public SubnetPropertiesFormat withAddressPrefixes(List addressPrefixes) /** * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values * include: 'Static', 'Dynamic'. - * + * * @return the ipAllocationMethod value. */ public IpAllocationMethodEnum ipAllocationMethod() { @@ -114,7 +115,7 @@ public IpAllocationMethodEnum 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. */ @@ -125,7 +126,7 @@ public SubnetPropertiesFormat withIpAllocationMethod(IpAllocationMethodEnum ipAl /** * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. - * + * * @return the ipConfigurationReferences value. */ public List ipConfigurationReferences() { @@ -134,7 +135,7 @@ public List ipConfiguration /** * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. - * + * * @param ipConfigurationReferences the ipConfigurationReferences value to set. * @return the SubnetPropertiesFormat object itself. */ @@ -146,7 +147,7 @@ public SubnetPropertiesFormat withIpConfigurationReferences( /** * Get the routeTable property: Route table resource. - * + * * @return the routeTable value. */ public RouteTable routeTable() { @@ -155,7 +156,7 @@ public RouteTable routeTable() { /** * Set the routeTable property: Route table resource. - * + * * @param routeTable the routeTable value to set. * @return the SubnetPropertiesFormat object itself. */ @@ -166,7 +167,7 @@ public SubnetPropertiesFormat withRouteTable(RouteTable routeTable) { /** * Get the ipPools property: network associated pool of IP Addresses. - * + * * @return the ipPools value. */ public List ipPools() { @@ -175,7 +176,7 @@ public List ipPools() { /** * Set the ipPools property: network associated pool of IP Addresses. - * + * * @param ipPools the ipPools value to set. * @return the SubnetPropertiesFormat object itself. */ @@ -186,7 +187,7 @@ public SubnetPropertiesFormat withIpPools(List ipPools) { /** * Get the vlan property: Vlan to use for the subnet. - * + * * @return the vlan value. */ public Integer vlan() { @@ -195,7 +196,7 @@ public Integer vlan() { /** * Set the vlan property: Vlan to use for the subnet. - * + * * @param vlan the vlan value to set. * @return the SubnetPropertiesFormat object itself. */ @@ -206,7 +207,7 @@ public SubnetPropertiesFormat withVlan(Integer vlan) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -220,4 +221,66 @@ public void validate() { 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 new file mode 100644 index 000000000000..e18efdf7e1ab --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java @@ -0,0 +1,707 @@ +// Copyright (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.CoreUtils; +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.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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Details of a singular Update in HCI Cluster. + */ +@Fluent +public final class UpdateProperties implements JsonSerializable { + /* + * Provisioning state of the Updates proxy resource. + */ + private ProvisioningState provisioningState; + + /* + * Date that the update was installed. + */ + private OffsetDateTime installedDate; + + /* + * Description of the update. + */ + private String description; + + /* + * State of the update as it relates to this stamp. + */ + private State state; + + /* + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates + * before installing this update. Otherwise, it is empty. + */ + private List prerequisites; + + /* + * An array of component versions for a Solution Bundle update, and an empty array otherwise. + */ + private List componentVersions; + + /* + * The rebootRequired property. + */ + private RebootRequirement rebootRequired; + + /* + * Overall health state for update-specific health checks. + */ + private HealthState healthState; + + /* + * An array of PrecheckResult objects. + */ + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + private OffsetDateTime healthCheckDate; + + /* + * Path where the update package is available. + */ + private String packagePath; + + /* + * Size of the package. This value is a combination of the size from update metadata and size of the payload that + * results from the live scan operation for OS update content. + */ + private Float packageSizeInMb; + + /* + * Display name of the Update + */ + private String displayName; + + /* + * Version of the update. + */ + private String version; + + /* + * Publisher of the update package. + */ + private String publisher; + + /* + * Link to release notes for the update. + */ + private String releaseLink; + + /* + * Indicates the way the update content can be downloaded. + */ + private AvailabilityType availabilityType; + + /* + * Customer-visible type of the update. + */ + private String packageType; + + /* + * Extensible KV pairs serialized as a string. This is currently used to report the stamp OEM family and hardware + * model information when an update is flagged as Invalid for the stamp based on OEM type. + */ + private String additionalProperties; + + /* + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for + * more details on this property. + */ + private UpdateStateProperties innerUpdateStateProperties; + + /** + * Creates an instance of UpdateProperties class. + */ + public UpdateProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.installedDate; + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withInstalledDate(OffsetDateTime installedDate) { + this.installedDate = installedDate; + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.prerequisites; + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPrerequisites(List prerequisites) { + this.prerequisites = prerequisites; + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.componentVersions; + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withComponentVersions(List componentVersions) { + this.componentVersions = componentVersions; + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.rebootRequired; + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withRebootRequired(RebootRequirement rebootRequired) { + this.rebootRequired = rebootRequired; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.packagePath; + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackagePath(String packagePath) { + this.packagePath = packagePath; + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.packageSizeInMb; + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageSizeInMb(Float packageSizeInMb) { + this.packageSizeInMb = packageSizeInMb; + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.releaseLink; + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withReleaseLink(String releaseLink) { + this.releaseLink = releaseLink; + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.availabilityType; + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAvailabilityType(AvailabilityType availabilityType) { + this.availabilityType = availabilityType; + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the innerUpdateStateProperties property: Additional information regarding the state of the update. See + * definition of UpdateStateProperties type below for more details on this property. + * + * @return the innerUpdateStateProperties value. + */ + private UpdateStateProperties innerUpdateStateProperties() { + return this.innerUpdateStateProperties; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerUpdateStateProperties() == null + ? null + : this.innerUpdateStateProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withProgressPercentage(Float progressPercentage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerUpdateStateProperties() == null ? null : this.innerUpdateStateProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withNotifyMessage(String notifyMessage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withNotifyMessage(notifyMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prerequisites() != null) { + prerequisites().forEach(e -> e.validate()); + } + if (componentVersions() != null) { + componentVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + if (innerUpdateStateProperties() != null) { + innerUpdateStateProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("installedDate", + this.installedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.installedDate)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("prerequisites", this.prerequisites, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("componentVersions", this.componentVersions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("rebootRequired", + this.rebootRequired == null ? null : this.rebootRequired.toString()); + jsonWriter.writeStringField("healthState", this.healthState == null ? null : this.healthState.toString()); + jsonWriter.writeArrayField("healthCheckResult", this.healthCheckResult, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("healthCheckDate", + this.healthCheckDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.healthCheckDate)); + jsonWriter.writeStringField("packagePath", this.packagePath); + jsonWriter.writeNumberField("packageSizeInMb", this.packageSizeInMb); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("releaseLink", this.releaseLink); + jsonWriter.writeStringField("availabilityType", + this.availabilityType == null ? null : this.availabilityType.toString()); + jsonWriter.writeStringField("packageType", this.packageType); + jsonWriter.writeStringField("additionalProperties", this.additionalProperties); + jsonWriter.writeJsonField("updateStateProperties", this.innerUpdateStateProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateProperties 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 UpdateProperties. + */ + public static UpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateProperties deserializedUpdateProperties = new UpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedUpdateProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("installedDate".equals(fieldName)) { + deserializedUpdateProperties.installedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedUpdateProperties.description = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedUpdateProperties.state = State.fromString(reader.getString()); + } else if ("prerequisites".equals(fieldName)) { + List prerequisites + = reader.readArray(reader1 -> UpdatePrerequisite.fromJson(reader1)); + deserializedUpdateProperties.prerequisites = prerequisites; + } else if ("componentVersions".equals(fieldName)) { + List componentVersions + = reader.readArray(reader1 -> PackageVersionInfo.fromJson(reader1)); + deserializedUpdateProperties.componentVersions = componentVersions; + } else if ("rebootRequired".equals(fieldName)) { + deserializedUpdateProperties.rebootRequired = RebootRequirement.fromString(reader.getString()); + } else if ("healthState".equals(fieldName)) { + deserializedUpdateProperties.healthState = HealthState.fromString(reader.getString()); + } else if ("healthCheckResult".equals(fieldName)) { + List healthCheckResult + = reader.readArray(reader1 -> PrecheckResult.fromJson(reader1)); + deserializedUpdateProperties.healthCheckResult = healthCheckResult; + } else if ("healthCheckDate".equals(fieldName)) { + deserializedUpdateProperties.healthCheckDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("packagePath".equals(fieldName)) { + deserializedUpdateProperties.packagePath = reader.getString(); + } else if ("packageSizeInMb".equals(fieldName)) { + deserializedUpdateProperties.packageSizeInMb = reader.getNullable(JsonReader::getFloat); + } else if ("displayName".equals(fieldName)) { + deserializedUpdateProperties.displayName = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedUpdateProperties.version = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedUpdateProperties.publisher = reader.getString(); + } else if ("releaseLink".equals(fieldName)) { + deserializedUpdateProperties.releaseLink = reader.getString(); + } else if ("availabilityType".equals(fieldName)) { + deserializedUpdateProperties.availabilityType = AvailabilityType.fromString(reader.getString()); + } else if ("packageType".equals(fieldName)) { + deserializedUpdateProperties.packageType = reader.getString(); + } else if ("additionalProperties".equals(fieldName)) { + deserializedUpdateProperties.additionalProperties = reader.getString(); + } else if ("updateStateProperties".equals(fieldName)) { + deserializedUpdateProperties.innerUpdateStateProperties = UpdateStateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateProperties; + }); + } +} 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 new file mode 100644 index 000000000000..d66fabf16335 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java @@ -0,0 +1,473 @@ +// Copyright (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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Details of an Update run. + */ +@Fluent +public final class UpdateRunInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Describes Update Run Properties. + */ + private UpdateRunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of UpdateRunInner class. + */ + public UpdateRunInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Describes Update Run Properties. + * + * @return the innerProperties value. + */ + private UpdateRunProperties 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 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 provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.innerProperties() == null ? null : this.innerProperties().timeStarted(); + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withTimeStarted(OffsetDateTime timeStarted) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withTimeStarted(timeStarted); + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTime(); + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.innerProperties() == null ? null : this.innerProperties().duration(); + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDuration(String duration) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDuration(duration); + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withState(UpdateRunPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withErrorMessage(String errorMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStatus(String status) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProperties() == null ? null : this.innerProperties().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withSteps(List steps) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withSteps(steps); + 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("location", this.location); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRunInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRunInner 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 UpdateRunInner. + */ + public static UpdateRunInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRunInner deserializedUpdateRunInner = new UpdateRunInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUpdateRunInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUpdateRunInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUpdateRunInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedUpdateRunInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedUpdateRunInner.innerProperties = UpdateRunProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUpdateRunInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRunInner; + }); + } +} 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 new file mode 100644 index 000000000000..f1cc3eca2b10 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java @@ -0,0 +1,410 @@ +// Copyright (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.CoreUtils; +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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Details of an Update run. + */ +@Fluent +public final class UpdateRunProperties implements JsonSerializable { + /* + * Provisioning state of the UpdateRuns proxy resource. + */ + private ProvisioningState provisioningState; + + /* + * Timestamp of the update run was started. + */ + private OffsetDateTime timeStarted; + + /* + * Timestamp of the most recently completed step in the update run. + */ + private OffsetDateTime lastUpdatedTime; + + /* + * Duration of the update run. + */ + private String duration; + + /* + * State of the update run. + */ + private UpdateRunPropertiesState state; + + /* + * Progress representation of the update run steps. + */ + private Step innerProgress; + + /** + * Creates an instance of UpdateRunProperties class. + */ + public UpdateRunProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.timeStarted; + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withTimeStarted(OffsetDateTime timeStarted) { + this.timeStarted = timeStarted; + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.state; + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withState(UpdateRunPropertiesState state) { + this.state = state; + return this; + } + + /** + * Get the innerProgress property: Progress representation of the update run steps. + * + * @return the innerProgress value. + */ + private Step innerProgress() { + return this.innerProgress; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.innerProgress() == null ? null : this.innerProgress().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withName(String name) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProgress() == null ? null : this.innerProgress().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDescription(String description) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProgress() == null ? null : this.innerProgress().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withErrorMessage(String errorMessage) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProgress() == null ? null : this.innerProgress().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStatus(String status) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProgress() == null ? null : this.innerProgress().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withSteps(List steps) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withSteps(steps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProgress() != null) { + innerProgress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeStarted", + this.timeStarted == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeStarted)); + jsonWriter.writeStringField("lastUpdatedTime", + this.lastUpdatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTime)); + jsonWriter.writeStringField("duration", this.duration); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeJsonField("progress", this.innerProgress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRunProperties 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 UpdateRunProperties. + */ + public static UpdateRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRunProperties deserializedUpdateRunProperties = new UpdateRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedUpdateRunProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("timeStarted".equals(fieldName)) { + deserializedUpdateRunProperties.timeStarted = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedTime".equals(fieldName)) { + deserializedUpdateRunProperties.lastUpdatedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedUpdateRunProperties.duration = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedUpdateRunProperties.state = UpdateRunPropertiesState.fromString(reader.getString()); + } else if ("progress".equals(fieldName)) { + deserializedUpdateRunProperties.innerProgress = Step.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRunProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java new file mode 100644 index 000000000000..17f7f7fe9a7a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.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.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; + +/** + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for more + * details on this property. + */ +@Fluent +public final class UpdateStateProperties implements JsonSerializable { + /* + * Progress percentage of ongoing operation. Currently this property is only valid when the update is in the + * Downloading state, where it maps to how much of the update content has been downloaded. + */ + private Float progressPercentage; + + /* + * Brief message with instructions for updates of AvailabilityType Notify. + */ + private String notifyMessage; + + /** + * Creates an instance of UpdateStateProperties class. + */ + public UpdateStateProperties() { + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withProgressPercentage(Float progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.notifyMessage; + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withNotifyMessage(String notifyMessage) { + this.notifyMessage = notifyMessage; + 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("progressPercentage", this.progressPercentage); + jsonWriter.writeStringField("notifyMessage", this.notifyMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateStateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateStateProperties 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 UpdateStateProperties. + */ + public static UpdateStateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateStateProperties deserializedUpdateStateProperties = new UpdateStateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("progressPercentage".equals(fieldName)) { + deserializedUpdateStateProperties.progressPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("notifyMessage".equals(fieldName)) { + deserializedUpdateStateProperties.notifyMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateStateProperties; + }); + } +} 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 new file mode 100644 index 000000000000..63c87a047934 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Get the update summaries for the cluster. + */ +@Fluent +public final class UpdateSummariesInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Update summaries properties + */ + private UpdateSummariesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * 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; + + /** + * Creates an instance of UpdateSummariesInner class. + */ + public UpdateSummariesInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update summaries properties. + * + * @return the innerProperties value. + */ + private UpdateSummariesProperties 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 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 provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.innerProperties() == null ? null : this.innerProperties().oemFamily(); + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withOemFamily(String oemFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withOemFamily(oemFamily); + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareModel(); + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHardwareModel(String hardwareModel) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHardwareModel(hardwareModel); + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersions(); + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withPackageVersions(List packageVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withPackageVersions(packageVersions); + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentVersion(); + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withCurrentVersion(String currentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withCurrentVersion(currentVersion); + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdated(); + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastUpdated(OffsetDateTime lastUpdated) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastUpdated(lastUpdated); + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.innerProperties() == null ? null : this.innerProperties().lastChecked(); + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastChecked(OffsetDateTime lastChecked) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastChecked(lastChecked); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withState(UpdateSummariesPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withState(state); + 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("location", this.location); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSummariesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSummariesInner 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 UpdateSummariesInner. + */ + public static UpdateSummariesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSummariesInner deserializedUpdateSummariesInner = new UpdateSummariesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUpdateSummariesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUpdateSummariesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUpdateSummariesInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedUpdateSummariesInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedUpdateSummariesInner.innerProperties = UpdateSummariesProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUpdateSummariesInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSummariesInner; + }); + } +} 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 new file mode 100644 index 000000000000..096ec118ec96 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java @@ -0,0 +1,390 @@ +// Copyright (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.CoreUtils; +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.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Properties of Update summaries. + */ +@Fluent +public final class UpdateSummariesProperties implements JsonSerializable { + /* + * Provisioning state of the UpdateSummaries proxy resource. + */ + private ProvisioningState provisioningState; + + /* + * OEM family name. + */ + private String oemFamily; + + /* + * Name of the hardware model. + */ + private String hardwareModel; + + /* + * Current version of each updatable component. + */ + private List packageVersions; + + /* + * Current Solution Bundle version of the stamp. + */ + private String currentVersion; + + /* + * Last time an update installation completed successfully. + */ + private OffsetDateTime lastUpdated; + + /* + * Last time the update service successfully checked for updates + */ + private OffsetDateTime lastChecked; + + /* + * Overall health state for update-specific health checks. + */ + private HealthState healthState; + + /* + * An array of pre-check result objects. + */ + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + private OffsetDateTime healthCheckDate; + + /* + * Overall update state of the stamp. + */ + private UpdateSummariesPropertiesState state; + + /** + * Creates an instance of UpdateSummariesProperties class. + */ + public UpdateSummariesProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.oemFamily; + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withOemFamily(String oemFamily) { + this.oemFamily = oemFamily; + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.hardwareModel; + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHardwareModel(String hardwareModel) { + this.hardwareModel = hardwareModel; + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.packageVersions; + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withPackageVersions(List packageVersions) { + this.packageVersions = packageVersions; + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.lastChecked; + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastChecked(OffsetDateTime lastChecked) { + this.lastChecked = lastChecked; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.state; + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withState(UpdateSummariesPropertiesState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageVersions() != null) { + packageVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("oemFamily", this.oemFamily); + jsonWriter.writeStringField("hardwareModel", this.hardwareModel); + jsonWriter.writeArrayField("packageVersions", this.packageVersions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("currentVersion", this.currentVersion); + jsonWriter.writeStringField("lastUpdated", + this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); + jsonWriter.writeStringField("lastChecked", + this.lastChecked == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastChecked)); + jsonWriter.writeStringField("healthState", this.healthState == null ? null : this.healthState.toString()); + jsonWriter.writeArrayField("healthCheckResult", this.healthCheckResult, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("healthCheckDate", + this.healthCheckDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.healthCheckDate)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSummariesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSummariesProperties 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 UpdateSummariesProperties. + */ + public static UpdateSummariesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSummariesProperties deserializedUpdateSummariesProperties = new UpdateSummariesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedUpdateSummariesProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("oemFamily".equals(fieldName)) { + deserializedUpdateSummariesProperties.oemFamily = reader.getString(); + } else if ("hardwareModel".equals(fieldName)) { + deserializedUpdateSummariesProperties.hardwareModel = reader.getString(); + } else if ("packageVersions".equals(fieldName)) { + List packageVersions + = reader.readArray(reader1 -> PackageVersionInfo.fromJson(reader1)); + deserializedUpdateSummariesProperties.packageVersions = packageVersions; + } else if ("currentVersion".equals(fieldName)) { + deserializedUpdateSummariesProperties.currentVersion = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedUpdateSummariesProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastChecked".equals(fieldName)) { + deserializedUpdateSummariesProperties.lastChecked = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("healthState".equals(fieldName)) { + deserializedUpdateSummariesProperties.healthState = HealthState.fromString(reader.getString()); + } else if ("healthCheckResult".equals(fieldName)) { + List healthCheckResult + = reader.readArray(reader1 -> PrecheckResult.fromJson(reader1)); + deserializedUpdateSummariesProperties.healthCheckResult = healthCheckResult; + } else if ("healthCheckDate".equals(fieldName)) { + deserializedUpdateSummariesProperties.healthCheckDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedUpdateSummariesProperties.state + = UpdateSummariesPropertiesState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSummariesProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ValidateResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ValidateResponseInner.java new file mode 100644 index 000000000000..14b31c03c549 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ValidateResponseInner.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.fluent.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; + +/** + * An Accepted response with an Operation-Location header. + */ +@Immutable +public final class ValidateResponseInner implements JsonSerializable { + /* + * edge device validation status + */ + private String status; + + /** + * Creates an instance of ValidateResponseInner class. + */ + public ValidateResponseInner() { + } + + /** + * Get the status property: edge device validation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * 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 ValidateResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateResponseInner 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 ValidateResponseInner. + */ + public static ValidateResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateResponseInner deserializedValidateResponseInner = new ValidateResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidateResponseInner.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateResponseInner; + }); + } +} 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 index 1b424339cfae..cf45d61ffc18 100644 --- 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 @@ -5,82 +5,80 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties under the virtual hard disk resource. */ +/** + * Properties under the virtual hard disk resource. + */ @Fluent -public final class VirtualHardDiskProperties { +public final class VirtualHardDiskProperties implements JsonSerializable { /* * The blockSizeBytes property. */ - @JsonProperty(value = "blockSizeBytes") private Integer blockSizeBytes; /* * Size of the disk in GB */ - @JsonProperty(value = "diskSizeGB") private Long diskSizeGB; /* * Boolean for enabling dynamic sizing on the virtual hard disk */ - @JsonProperty(value = "dynamic") private Boolean dynamic; /* * The logicalSectorBytes property. */ - @JsonProperty(value = "logicalSectorBytes") private Integer logicalSectorBytes; /* * The physicalSectorBytes property. */ - @JsonProperty(value = "physicalSectorBytes") private Integer physicalSectorBytes; /* * The hypervisor generation of the Virtual Machine [V1, V2] */ - @JsonProperty(value = "hyperVGeneration") private HyperVGeneration hyperVGeneration; /* * The format of the actual VHD file [vhd, vhdx] */ - @JsonProperty(value = "diskFileFormat") private DiskFileFormat diskFileFormat; /* * Provisioning state of the virtual hard disk. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * Storage ContainerID of the storage container to be used for VHD */ - @JsonProperty(value = "containerId") private String containerId; /* * The observed state of virtual hard disks */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private VirtualHardDiskStatus status; - /** Creates an instance of VirtualHardDiskProperties class. */ + /** + * Creates an instance of VirtualHardDiskProperties class. + */ public VirtualHardDiskProperties() { } /** * Get the blockSizeBytes property: The blockSizeBytes property. - * + * * @return the blockSizeBytes value. */ public Integer blockSizeBytes() { @@ -89,7 +87,7 @@ public Integer blockSizeBytes() { /** * Set the blockSizeBytes property: The blockSizeBytes property. - * + * * @param blockSizeBytes the blockSizeBytes value to set. * @return the VirtualHardDiskProperties object itself. */ @@ -100,7 +98,7 @@ public VirtualHardDiskProperties withBlockSizeBytes(Integer blockSizeBytes) { /** * Get the diskSizeGB property: Size of the disk in GB. - * + * * @return the diskSizeGB value. */ public Long diskSizeGB() { @@ -109,7 +107,7 @@ public Long diskSizeGB() { /** * Set the diskSizeGB property: Size of the disk in GB. - * + * * @param diskSizeGB the diskSizeGB value to set. * @return the VirtualHardDiskProperties object itself. */ @@ -120,7 +118,7 @@ public VirtualHardDiskProperties withDiskSizeGB(Long diskSizeGB) { /** * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. - * + * * @return the dynamic value. */ public Boolean dynamic() { @@ -129,7 +127,7 @@ public Boolean 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. */ @@ -140,7 +138,7 @@ public VirtualHardDiskProperties withDynamic(Boolean dynamic) { /** * Get the logicalSectorBytes property: The logicalSectorBytes property. - * + * * @return the logicalSectorBytes value. */ public Integer logicalSectorBytes() { @@ -149,7 +147,7 @@ public Integer logicalSectorBytes() { /** * Set the logicalSectorBytes property: The logicalSectorBytes property. - * + * * @param logicalSectorBytes the logicalSectorBytes value to set. * @return the VirtualHardDiskProperties object itself. */ @@ -160,7 +158,7 @@ public VirtualHardDiskProperties withLogicalSectorBytes(Integer logicalSectorByt /** * Get the physicalSectorBytes property: The physicalSectorBytes property. - * + * * @return the physicalSectorBytes value. */ public Integer physicalSectorBytes() { @@ -169,7 +167,7 @@ public Integer physicalSectorBytes() { /** * Set the physicalSectorBytes property: The physicalSectorBytes property. - * + * * @param physicalSectorBytes the physicalSectorBytes value to set. * @return the VirtualHardDiskProperties object itself. */ @@ -180,7 +178,7 @@ public VirtualHardDiskProperties withPhysicalSectorBytes(Integer physicalSectorB /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -189,7 +187,7 @@ public HyperVGeneration 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. */ @@ -200,7 +198,7 @@ public VirtualHardDiskProperties withHyperVGeneration(HyperVGeneration hyperVGen /** * Get the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. - * + * * @return the diskFileFormat value. */ public DiskFileFormat diskFileFormat() { @@ -209,7 +207,7 @@ public DiskFileFormat 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. */ @@ -220,7 +218,7 @@ public VirtualHardDiskProperties withDiskFileFormat(DiskFileFormat diskFileForma /** * Get the provisioningState property: Provisioning state of the virtual hard disk. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -229,7 +227,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the containerId property: Storage ContainerID of the storage container to be used for VHD. - * + * * @return the containerId value. */ public String containerId() { @@ -238,7 +236,7 @@ public String 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. */ @@ -249,7 +247,7 @@ public VirtualHardDiskProperties withContainerId(String containerId) { /** * Get the status property: The observed state of virtual hard disks. - * + * * @return the status value. */ public VirtualHardDiskStatus status() { @@ -258,7 +256,7 @@ public VirtualHardDiskStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -266,4 +264,70 @@ public void validate() { 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 index a335eb5f2d37..3006fd19584c 100644 --- 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 @@ -7,42 +7,61 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The virtual hard disk resource definition. */ +/** + * The virtual hard disk resource definition. + */ @Fluent public final class VirtualHardDisksInner extends Resource { /* * Properties under the virtual hard disk resource */ - @JsonProperty(value = "properties") private VirtualHardDiskProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of VirtualHardDisksInner class. */ + /* + * 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; + + /** + * 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() { @@ -51,7 +70,7 @@ private VirtualHardDiskProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -60,7 +79,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the VirtualHardDisksInner object itself. */ @@ -71,21 +90,55 @@ public VirtualHardDisksInner withExtendedLocation(ExtendedLocation extendedLocat /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * 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; + } + + /** + * {@inheritDoc} + */ @Override public VirtualHardDisksInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VirtualHardDisksInner withTags(Map tags) { super.withTags(tags); @@ -94,7 +147,7 @@ public VirtualHardDisksInner withTags(Map tags) { /** * Get the blockSizeBytes property: The blockSizeBytes property. - * + * * @return the blockSizeBytes value. */ public Integer blockSizeBytes() { @@ -103,7 +156,7 @@ public Integer blockSizeBytes() { /** * Set the blockSizeBytes property: The blockSizeBytes property. - * + * * @param blockSizeBytes the blockSizeBytes value to set. * @return the VirtualHardDisksInner object itself. */ @@ -117,7 +170,7 @@ public VirtualHardDisksInner withBlockSizeBytes(Integer blockSizeBytes) { /** * Get the diskSizeGB property: Size of the disk in GB. - * + * * @return the diskSizeGB value. */ public Long diskSizeGB() { @@ -126,7 +179,7 @@ public Long diskSizeGB() { /** * Set the diskSizeGB property: Size of the disk in GB. - * + * * @param diskSizeGB the diskSizeGB value to set. * @return the VirtualHardDisksInner object itself. */ @@ -140,7 +193,7 @@ public VirtualHardDisksInner withDiskSizeGB(Long diskSizeGB) { /** * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. - * + * * @return the dynamic value. */ public Boolean dynamic() { @@ -149,7 +202,7 @@ public Boolean 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. */ @@ -163,7 +216,7 @@ public VirtualHardDisksInner withDynamic(Boolean dynamic) { /** * Get the logicalSectorBytes property: The logicalSectorBytes property. - * + * * @return the logicalSectorBytes value. */ public Integer logicalSectorBytes() { @@ -172,7 +225,7 @@ public Integer logicalSectorBytes() { /** * Set the logicalSectorBytes property: The logicalSectorBytes property. - * + * * @param logicalSectorBytes the logicalSectorBytes value to set. * @return the VirtualHardDisksInner object itself. */ @@ -186,7 +239,7 @@ public VirtualHardDisksInner withLogicalSectorBytes(Integer logicalSectorBytes) /** * Get the physicalSectorBytes property: The physicalSectorBytes property. - * + * * @return the physicalSectorBytes value. */ public Integer physicalSectorBytes() { @@ -195,7 +248,7 @@ public Integer physicalSectorBytes() { /** * Set the physicalSectorBytes property: The physicalSectorBytes property. - * + * * @param physicalSectorBytes the physicalSectorBytes value to set. * @return the VirtualHardDisksInner object itself. */ @@ -209,7 +262,7 @@ public VirtualHardDisksInner withPhysicalSectorBytes(Integer physicalSectorBytes /** * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. - * + * * @return the hyperVGeneration value. */ public HyperVGeneration hyperVGeneration() { @@ -218,7 +271,7 @@ public HyperVGeneration 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. */ @@ -232,7 +285,7 @@ public VirtualHardDisksInner withHyperVGeneration(HyperVGeneration hyperVGenerat /** * Get the diskFileFormat property: The format of the actual VHD file [vhd, vhdx]. - * + * * @return the diskFileFormat value. */ public DiskFileFormat diskFileFormat() { @@ -241,7 +294,7 @@ public DiskFileFormat 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. */ @@ -255,7 +308,7 @@ public VirtualHardDisksInner withDiskFileFormat(DiskFileFormat diskFileFormat) { /** * Get the provisioningState property: Provisioning state of the virtual hard disk. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -264,7 +317,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the containerId property: Storage ContainerID of the storage container to be used for VHD. - * + * * @return the containerId value. */ public String containerId() { @@ -273,7 +326,7 @@ public String 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. */ @@ -287,7 +340,7 @@ public VirtualHardDisksInner withContainerId(String containerId) { /** * Get the status property: The observed state of virtual hard disks. - * + * * @return the status value. */ public VirtualHardDiskStatus status() { @@ -296,7 +349,7 @@ public VirtualHardDiskStatus status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -307,4 +360,59 @@ public void validate() { 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 index eae851615ccb..4e001a5a8965 100644 --- 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 @@ -7,6 +7,9 @@ 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; @@ -19,42 +22,57 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus; import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The virtual machine instance resource definition. */ +/** + * The virtual machine instance resource definition. + */ @Fluent public final class VirtualMachineInstanceInner extends ProxyResource { /* * Properties under the virtual machine instance resource */ - @JsonProperty(value = "properties") private VirtualMachineInstanceProperties innerProperties; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Identity for the resource. */ - @JsonProperty(value = "identity") private Identity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of VirtualMachineInstanceInner class. */ + /* + * 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; + + /** + * 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() { @@ -63,7 +81,7 @@ private VirtualMachineInstanceProperties innerProperties() { /** * Get the extendedLocation property: The extendedLocation of the resource. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -72,7 +90,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extendedLocation of the resource. - * + * * @param extendedLocation the extendedLocation value to set. * @return the VirtualMachineInstanceInner object itself. */ @@ -83,7 +101,7 @@ public VirtualMachineInstanceInner withExtendedLocation(ExtendedLocation extende /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -92,7 +110,7 @@ public Identity identity() { /** * Set the identity property: Identity for the resource. - * + * * @param identity the identity value to set. * @return the VirtualMachineInstanceInner object itself. */ @@ -103,17 +121,47 @@ public VirtualMachineInstanceInner withIdentity(Identity identity) { /** * 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 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 hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine * instance. - * + * * @return the hardwareProfile value. */ public VirtualMachineInstancePropertiesHardwareProfile hardwareProfile() { @@ -123,12 +171,12 @@ public VirtualMachineInstancePropertiesHardwareProfile 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) { + public VirtualMachineInstanceInner + withHardwareProfile(VirtualMachineInstancePropertiesHardwareProfile hardwareProfile) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineInstanceProperties(); } @@ -139,7 +187,7 @@ public VirtualMachineInstanceInner withHardwareProfile( /** * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine * instance. - * + * * @return the networkProfile value. */ public VirtualMachineInstancePropertiesNetworkProfile networkProfile() { @@ -149,12 +197,12 @@ public VirtualMachineInstancePropertiesNetworkProfile 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) { + public VirtualMachineInstanceInner + withNetworkProfile(VirtualMachineInstancePropertiesNetworkProfile networkProfile) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineInstanceProperties(); } @@ -164,7 +212,7 @@ public VirtualMachineInstanceInner withNetworkProfile( /** * Get the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. - * + * * @return the osProfile value. */ public VirtualMachineInstancePropertiesOsProfile osProfile() { @@ -173,7 +221,7 @@ public VirtualMachineInstancePropertiesOsProfile 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. */ @@ -188,7 +236,7 @@ public VirtualMachineInstanceInner withOsProfile(VirtualMachineInstancePropertie /** * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine * instance. - * + * * @return the securityProfile value. */ public VirtualMachineInstancePropertiesSecurityProfile securityProfile() { @@ -198,12 +246,12 @@ public VirtualMachineInstancePropertiesSecurityProfile 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) { + public VirtualMachineInstanceInner + withSecurityProfile(VirtualMachineInstancePropertiesSecurityProfile securityProfile) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineInstanceProperties(); } @@ -214,7 +262,7 @@ public VirtualMachineInstanceInner withSecurityProfile( /** * 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() { @@ -224,12 +272,12 @@ public VirtualMachineInstancePropertiesStorageProfile 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) { + public VirtualMachineInstanceInner + withStorageProfile(VirtualMachineInstancePropertiesStorageProfile storageProfile) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineInstanceProperties(); } @@ -239,7 +287,7 @@ public VirtualMachineInstanceInner withStorageProfile( /** * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. - * + * * @return the httpProxyConfig value. */ public HttpProxyConfiguration httpProxyConfig() { @@ -248,7 +296,7 @@ public HttpProxyConfiguration httpProxyConfig() { /** * Set the httpProxyConfig property: HTTP Proxy configuration for the VM. - * + * * @param httpProxyConfig the httpProxyConfig value to set. * @return the VirtualMachineInstanceInner object itself. */ @@ -262,7 +310,7 @@ public VirtualMachineInstanceInner withHttpProxyConfig(HttpProxyConfiguration ht /** * Get the provisioningState property: Provisioning state of the virtual machine instance. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -271,7 +319,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the instanceView property: The virtual machine instance view. - * + * * @return the instanceView value. */ public VirtualMachineInstanceView instanceView() { @@ -280,7 +328,7 @@ public VirtualMachineInstanceView instanceView() { /** * Get the status property: The observed state of virtual machine instances. - * + * * @return the status value. */ public VirtualMachineInstanceStatus status() { @@ -289,7 +337,7 @@ public VirtualMachineInstanceStatus status() { /** * Get the guestAgentInstallStatus property: Guest agent install status. - * + * * @return the guestAgentInstallStatus value. */ public GuestAgentInstallStatus guestAgentInstallStatus() { @@ -298,7 +346,7 @@ public GuestAgentInstallStatus guestAgentInstallStatus() { /** * Set the guestAgentInstallStatus property: Guest agent install status. - * + * * @param guestAgentInstallStatus the guestAgentInstallStatus value to set. * @return the VirtualMachineInstanceInner object itself. */ @@ -312,7 +360,7 @@ public VirtualMachineInstanceInner withGuestAgentInstallStatus(GuestAgentInstall /** * Get the vmId property: Unique identifier for the vm resource. - * + * * @return the vmId value. */ public String vmId() { @@ -321,7 +369,7 @@ public String vmId() { /** * Get the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. - * + * * @return the resourceUid value. */ public String resourceUid() { @@ -330,7 +378,7 @@ public String 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. */ @@ -344,7 +392,7 @@ public VirtualMachineInstanceInner withResourceUid(String resourceUid) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -358,4 +406,56 @@ public void validate() { 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 index 49c9a61c58e4..f00aa6be050c 100644 --- 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 @@ -5,6 +5,10 @@ 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; @@ -15,91 +19,83 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus; import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties under the virtual machine instance resource. */ +/** + * Properties under the virtual machine instance resource. + */ @Fluent -public final class VirtualMachineInstanceProperties { +public final class VirtualMachineInstanceProperties implements JsonSerializable { /* * HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ - @JsonProperty(value = "hardwareProfile") private VirtualMachineInstancePropertiesHardwareProfile hardwareProfile; /* * NetworkProfile - describes the network configuration the virtual machine instance */ - @JsonProperty(value = "networkProfile") private VirtualMachineInstancePropertiesNetworkProfile networkProfile; /* * OsProfile - describes the configuration of the operating system and sets login data */ - @JsonProperty(value = "osProfile") private VirtualMachineInstancePropertiesOsProfile osProfile; /* * SecurityProfile - Specifies the security settings for the virtual machine instance. */ - @JsonProperty(value = "securityProfile") private VirtualMachineInstancePropertiesSecurityProfile securityProfile; /* * StorageProfile - contains information about the disks and storage information for the virtual machine instance */ - @JsonProperty(value = "storageProfile") private VirtualMachineInstancePropertiesStorageProfile storageProfile; /* * HTTP Proxy configuration for the VM. */ - @JsonProperty(value = "httpProxyConfig") private HttpProxyConfiguration httpProxyConfig; /* * Provisioning state of the virtual machine instance. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStateEnum provisioningState; /* * The virtual machine instance view. */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) private VirtualMachineInstanceView instanceView; /* * The observed state of virtual machine instances */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private VirtualMachineInstanceStatus status; /* * Guest agent install status. */ - @JsonProperty(value = "guestAgentInstallStatus") private GuestAgentInstallStatus guestAgentInstallStatus; /* * Unique identifier for the vm resource. */ - @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) private String vmId; /* * Unique identifier defined by ARC to identify the guest of the VM. */ - @JsonProperty(value = "resourceUid") private String resourceUid; - /** Creates an instance of VirtualMachineInstanceProperties class. */ + /** + * 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() { @@ -109,12 +105,12 @@ public VirtualMachineInstancePropertiesHardwareProfile 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) { + public VirtualMachineInstanceProperties + withHardwareProfile(VirtualMachineInstancePropertiesHardwareProfile hardwareProfile) { this.hardwareProfile = hardwareProfile; return this; } @@ -122,7 +118,7 @@ public VirtualMachineInstanceProperties withHardwareProfile( /** * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine * instance. - * + * * @return the networkProfile value. */ public VirtualMachineInstancePropertiesNetworkProfile networkProfile() { @@ -132,19 +128,19 @@ public VirtualMachineInstancePropertiesNetworkProfile 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) { + 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() { @@ -153,7 +149,7 @@ public VirtualMachineInstancePropertiesOsProfile 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. */ @@ -165,7 +161,7 @@ public VirtualMachineInstanceProperties withOsProfile(VirtualMachineInstanceProp /** * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine * instance. - * + * * @return the securityProfile value. */ public VirtualMachineInstancePropertiesSecurityProfile securityProfile() { @@ -175,12 +171,12 @@ public VirtualMachineInstancePropertiesSecurityProfile 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) { + public VirtualMachineInstanceProperties + withSecurityProfile(VirtualMachineInstancePropertiesSecurityProfile securityProfile) { this.securityProfile = securityProfile; return this; } @@ -188,7 +184,7 @@ public VirtualMachineInstanceProperties withSecurityProfile( /** * 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() { @@ -198,19 +194,19 @@ public VirtualMachineInstancePropertiesStorageProfile 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) { + 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() { @@ -219,7 +215,7 @@ public HttpProxyConfiguration httpProxyConfig() { /** * Set the httpProxyConfig property: HTTP Proxy configuration for the VM. - * + * * @param httpProxyConfig the httpProxyConfig value to set. * @return the VirtualMachineInstanceProperties object itself. */ @@ -230,7 +226,7 @@ public VirtualMachineInstanceProperties withHttpProxyConfig(HttpProxyConfigurati /** * Get the provisioningState property: Provisioning state of the virtual machine instance. - * + * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { @@ -239,7 +235,7 @@ public ProvisioningStateEnum provisioningState() { /** * Get the instanceView property: The virtual machine instance view. - * + * * @return the instanceView value. */ public VirtualMachineInstanceView instanceView() { @@ -248,7 +244,7 @@ public VirtualMachineInstanceView instanceView() { /** * Get the status property: The observed state of virtual machine instances. - * + * * @return the status value. */ public VirtualMachineInstanceStatus status() { @@ -257,7 +253,7 @@ public VirtualMachineInstanceStatus status() { /** * Get the guestAgentInstallStatus property: Guest agent install status. - * + * * @return the guestAgentInstallStatus value. */ public GuestAgentInstallStatus guestAgentInstallStatus() { @@ -266,19 +262,19 @@ public GuestAgentInstallStatus 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) { + 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() { @@ -287,7 +283,7 @@ public String vmId() { /** * Get the resourceUid property: Unique identifier defined by ARC to identify the guest of the VM. - * + * * @return the resourceUid value. */ public String resourceUid() { @@ -296,7 +292,7 @@ public String 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. */ @@ -307,7 +303,7 @@ public VirtualMachineInstanceProperties withResourceUid(String resourceUid) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -339,4 +335,79 @@ public void validate() { 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/fluent/models/package-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/package-info.java index cb01ac2fa2c4..611f7358c042 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/package-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for AzureStackHciClient. Azure Stack HCI management service. */ +/** + * Package containing the inner data models for AzureStackHciClient. + * Azure Stack HCI management service. + */ package com.azure.resourcemanager.azurestackhci.fluent.models; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/package-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/package-info.java index 187c45a59c4b..d0573888c104 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/package-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for AzureStackHciClient. Azure Stack HCI management service. */ +/** + * Package containing the service clients for AzureStackHciClient. + * Azure Stack HCI management service. + */ package com.azure.resourcemanager.azurestackhci.fluent; 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 new file mode 100644 index 000000000000..54ac1517757b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; + +public final class ArcIdentityResponseImpl implements ArcIdentityResponse { + private ArcIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ArcIdentityResponseImpl(ArcIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + + public ArcIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java new file mode 100644 index 000000000000..36a7f582212d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition, ArcSetting.Update { + private ArcSettingInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String arcInstanceResourceGroup() { + return this.innerModel().arcInstanceResourceGroup(); + } + + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + + public ArcSettingAggregateState aggregateState() { + return this.innerModel().aggregateState(); + } + + public List perNodeDetails() { + List inner = this.innerModel().perNodeDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Object connectivityProperties() { + return this.innerModel().connectivityProperties(); + } + + public List defaultExtensions() { + List inner = this.innerModel().defaultExtensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ArcSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String arcSettingName; + + private ArcSettingsPatch updateArcSetting; + + public ArcSettingImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ArcSetting create() { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArcSetting create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), context) + .getValue(); + return this; + } + + ArcSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new ArcSettingInner(); + this.serviceManager = serviceManager; + this.arcSettingName = name; + } + + public ArcSettingImpl update() { + this.updateArcSetting = new ArcSettingsPatch(); + return this; + } + + public ArcSetting apply() { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, Context.NONE) + .getValue(); + return this; + } + + public ArcSetting apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, context) + .getValue(); + return this; + } + + ArcSettingImpl(ArcSettingInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.arcSettingName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "arcSettings"); + } + + public ArcSetting refresh() { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE) + .getValue(); + return this; + } + + public ArcSetting refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getArcSettings() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, context) + .getValue(); + return this; + } + + public Response generatePasswordWithResponse(Context context) { + return serviceManager.arcSettings() + .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + + public ArcIdentityResponse createIdentity() { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); + } + + public ArcIdentityResponse createIdentity(Context context) { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + } + + public Response consentAndInstallDefaultExtensionsWithResponse(Context context) { + return serviceManager.arcSettings() + .consentAndInstallDefaultExtensionsWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcSetting consentAndInstallDefaultExtensions() { + return serviceManager.arcSettings() + .consentAndInstallDefaultExtensions(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess() { + serviceManager.arcSettings().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess(Context context) { + serviceManager.arcSettings().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcSettingImpl withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + this.innerModel().withArcInstanceResourceGroup(arcInstanceResourceGroup); + return this; + } + + public ArcSettingImpl withArcApplicationClientId(String arcApplicationClientId) { + this.innerModel().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + public ArcSettingImpl withArcApplicationTenantId(String arcApplicationTenantId) { + this.innerModel().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + public ArcSettingImpl withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.innerModel().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + public ArcSettingImpl withArcApplicationObjectId(String arcApplicationObjectId) { + this.innerModel().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + public ArcSettingImpl withConnectivityProperties(Object connectivityProperties) { + if (isInCreateMode()) { + this.innerModel().withConnectivityProperties(connectivityProperties); + return this; + } else { + this.updateArcSetting.withConnectivityProperties(connectivityProperties); + return this; + } + } + + public ArcSettingImpl withTags(Map tags) { + this.updateArcSetting.withTags(tags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java new file mode 100644 index 000000000000..aec4711584ef --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -0,0 +1,1737 @@ +// Copyright (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.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingList; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ArcSettingsClient. + */ +public final class ArcSettingsClientImpl implements ArcSettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ArcSettingsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of ArcSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArcSettingsClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(ArcSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientArcSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientA") + public interface ArcSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ArcSettingInner arcSetting, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ArcSettingsPatch arcSetting, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generatePassword(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> consentAndInstallDefaultExtensions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> initializeDisableProcess(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingInner arcSetting) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingInner arcSetting, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingInner arcSetting) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingInner arcSetting, Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner create(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingInner arcSetting) { + return createWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingsPatch arcSetting) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingsPatch arcSetting, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingsPatch arcSetting) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, ArcSettingsPatch arcSetting, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner update(String resourceGroupName, String clusterName, String arcSettingName, + ArcSettingsPatch arcSetting) { + return updateWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String arcSettingName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { + deleteAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generatePassword(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generatePassword(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatePasswordAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generatePasswordWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, + String arcSettingName) { + return generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> + beginCreateIdentityAsync(String resourceGroupName, String clusterName, String arcSettingName) { + Mono>> mono + = createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArcIdentityResponseInner.class, ArcIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> + beginCreateIdentityAsync(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArcIdentityResponseInner.class, ArcIdentityResponseInner.class, context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName) { + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, + String arcSettingName) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> consentAndInstallDefaultExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.consentAndInstallDefaultExtensions(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, arcSettingName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> consentAndInstallDefaultExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.consentAndInstallDefaultExtensions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono consentAndInstallDefaultExtensionsAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + return consentAndInstallDefaultExtensionsWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response consentAndInstallDefaultExtensionsWithResponse(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + return consentAndInstallDefaultExtensionsWithResponseAsync(resourceGroupName, clusterName, arcSettingName, + context).block(); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName, + String arcSettingName) { + return consentAndInstallDefaultExtensionsWithResponse(resourceGroupName, clusterName, arcSettingName, + Context.NONE).getValue(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> initializeDisableProcessWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.initializeDisableProcess(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> initializeDisableProcessWithResponseAsync(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.initializeDisableProcess(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginInitializeDisableProcessAsync(String resourceGroupName, + String clusterName, String arcSettingName) { + Mono>> mono + = initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginInitializeDisableProcessAsync(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginInitializeDisableProcess(String resourceGroupName, + String clusterName, String arcSettingName) { + return this.beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginInitializeDisableProcess(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + return this.beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context) + .getSyncPoller(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 initializeDisableProcessAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 initializeDisableProcessAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName) { + initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * 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 ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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 ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java new file mode 100644 index 000000000000..6763384442bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import com.azure.resourcemanager.azurestackhci.models.ArcSettings; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; + +public final class ArcSettingsImpl implements ArcSettings { + private static final ClientLogger LOGGER = new ClientLogger(ArcSettingsImpl.class); + + private final ArcSettingsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public ArcSettingsImpl(ArcSettingsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner + = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArcSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { + ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName); + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); + } + + public Response generatePasswordWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + Response inner = this.serviceClient() + .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PasswordCredentialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { + PasswordCredentialInner inner + = this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new PasswordCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { + ArcIdentityResponseInner inner + = this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + ArcIdentityResponseInner inner + = this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response consentAndInstallDefaultExtensionsWithResponse(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + Response inner = this.serviceClient() + .consentAndInstallDefaultExtensionsWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArcSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArcSetting consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName, + String arcSettingName) { + ArcSettingInner inner + = this.serviceClient().consentAndInstallDefaultExtensions(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName) { + this.serviceClient().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, + Context context) { + this.serviceClient().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcSetting 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public void deleteById(String id) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, context); + } + + private ArcSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public ArcSettingImpl define(String name) { + return new ArcSettingImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index dafafa520ac6..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 @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the AzureStackHciClientImpl type. */ -@ServiceClientBuilder(serviceClients = {AzureStackHciClientImpl.class}) +/** + * A builder for creating a new instance of the AzureStackHciClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { AzureStackHciClientImpl.class }) public final class AzureStackHciClientBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class AzureStackHciClientBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the AzureStackHciClientBuilder. */ @@ -40,7 +42,7 @@ public AzureStackHciClientBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the AzureStackHciClientBuilder. */ @@ -56,7 +58,7 @@ public AzureStackHciClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the AzureStackHciClientBuilder. */ @@ -72,7 +74,7 @@ public AzureStackHciClientBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the AzureStackHciClientBuilder. */ @@ -88,7 +90,7 @@ public AzureStackHciClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the AzureStackHciClientBuilder. */ @@ -104,7 +106,7 @@ public AzureStackHciClientBuilder defaultPollInterval(Duration defaultPollInterv /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the AzureStackHciClientBuilder. */ @@ -115,30 +117,22 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer /** * Builds an instance of AzureStackHciClientImpl with the provided parameters. - * + * * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureStackHciClientImpl client = - new AzureStackHciClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - this.subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AzureStackHciClientImpl client = new AzureStackHciClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index 45cc6e53fb78..b68076beb6e1 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.azurestackhci.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,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.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -22,7 +23,12 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; +import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.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; @@ -30,8 +36,15 @@ 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.VirtualHardDisksOperationsClient; import com.azure.resourcemanager.azurestackhci.fluent.VirtualMachineInstancesClient; import java.io.IOException; @@ -43,207 +56,411 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the AzureStackHciClientImpl type. */ +/** + * Initializes a new instance of the AzureStackHciClientImpl type. + */ @ServiceClient(builder = AzureStackHciClientBuilder.class) public final class AzureStackHciClientImpl implements AzureStackHciClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The GalleryImagesOperationsClient object to access its operations. */ + /** + * The ArcSettingsClient object to access its operations. + */ + private final ArcSettingsClient arcSettings; + + /** + * Gets the ArcSettingsClient object to access its operations. + * + * @return the ArcSettingsClient object. + */ + public ArcSettingsClient getArcSettings() { + return this.arcSettings; + } + + /** + * The ClustersClient object to access its operations. + */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** + * The DeploymentSettingsClient object to access its operations. + */ + private final DeploymentSettingsClient deploymentSettings; + + /** + * Gets the DeploymentSettingsClient object to access its operations. + * + * @return the DeploymentSettingsClient object. + */ + public DeploymentSettingsClient getDeploymentSettings() { + return this.deploymentSettings; + } + + /** + * The EdgeDevicesClient object to access its operations. + */ + private final EdgeDevicesClient edgeDevices; + + /** + * Gets the EdgeDevicesClient object to access its operations. + * + * @return the EdgeDevicesClient object. + */ + public EdgeDevicesClient getEdgeDevices() { + return this.edgeDevices; + } + + /** + * The ExtensionsClient object to access its operations. + */ + private final ExtensionsClient extensions; + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + 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 OperationsClient object to access its operations. */ - private final OperationsClient operations; - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * The LogicalNetworksOperationsClient object to access its operations. */ - public OperationsClient getOperations() { - return this.operations; - } - - /** 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. */ + /** + * 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. */ + /** + * 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 StorageContainersOperationsClient object to access its operations. */ + /** + * The OffersClient object to access its operations. + */ + private final OffersClient offers; + + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + public OffersClient getOffers() { + return this.offers; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The PublishersClient object to access its operations. + */ + private final PublishersClient publishers; + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + public PublishersClient getPublishers() { + return this.publishers; + } + + /** + * The SecuritySettingsClient object to access its operations. + */ + private final SecuritySettingsClient securitySettings; + + /** + * Gets the SecuritySettingsClient object to access its operations. + * + * @return the SecuritySettingsClient object. + */ + public SecuritySettingsClient getSecuritySettings() { + return this.securitySettings; + } + + /** + * The SkusClient object to access its operations. + */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + 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 VirtualHardDisksOperationsClient object to access its operations. */ + /** + * The UpdateRunsClient object to access its operations. + */ + private final UpdateRunsClient updateRuns; + + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + public UpdateRunsClient getUpdateRuns() { + return this.updateRuns; + } + + /** + * The UpdateSummariesOperationsClient object to access its operations. + */ + private final UpdateSummariesOperationsClient updateSummariesOperations; + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + public UpdateSummariesOperationsClient getUpdateSummariesOperations() { + return this.updateSummariesOperations; + } + + /** + * The UpdatesClient object to access its operations. + */ + private final UpdatesClient updates; + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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() { @@ -252,7 +469,7 @@ public GuestAgentsOperationsClient getGuestAgentsOperations() { /** * Initializes an instance of AzureStackHciClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -260,25 +477,32 @@ public GuestAgentsOperationsClient getGuestAgentsOperations() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - AzureStackHciClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + AzureStackHciClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-09-01-preview"; + 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.operations = new OperationsClientImpl(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); @@ -288,7 +512,7 @@ public GuestAgentsOperationsClient getGuestAgentsOperations() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -297,7 +521,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -307,7 +531,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -317,26 +541,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -349,19 +562,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -402,7 +612,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { 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 new file mode 100644 index 000000000000..54b4e3a155b0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; + +public final class ClusterIdentityResponseImpl implements ClusterIdentityResponse { + private ClusterIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ClusterIdentityResponseImpl(ClusterIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aadClientId() { + return this.innerModel().aadClientId(); + } + + public String aadTenantId() { + return this.innerModel().aadTenantId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public ClusterIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java new file mode 100644 index 000000000000..74318753fd10 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.ConnectivityStatus; +import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; +import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public UUID principalId() { + return this.innerModel().principalId(); + } + + public UUID tenantId() { + return this.innerModel().tenantId(); + } + + public ManagedServiceIdentityType typeIdentityType() { + return this.innerModel().typeIdentityType(); + } + + public Map userAssignedIdentities() { + Map inner = this.innerModel().userAssignedIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Status status() { + return this.innerModel().status(); + } + + public ConnectivityStatus connectivityStatus() { + return this.innerModel().connectivityStatus(); + } + + public String cloudId() { + return this.innerModel().cloudId(); + } + + public String cloudManagementEndpoint() { + return this.innerModel().cloudManagementEndpoint(); + } + + public String aadClientId() { + return this.innerModel().aadClientId(); + } + + public String aadTenantId() { + return this.innerModel().aadTenantId(); + } + + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerModel().softwareAssuranceProperties(); + } + + public ClusterDesiredProperties desiredProperties() { + return this.innerModel().desiredProperties(); + } + + public ClusterReportedProperties reportedProperties() { + return this.innerModel().reportedProperties(); + } + + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.innerModel().isolatedVmAttestationConfiguration(); + } + + public Float trialDaysRemaining() { + return this.innerModel().trialDaysRemaining(); + } + + public String billingModel() { + return this.innerModel().billingModel(); + } + + public OffsetDateTime registrationTimestamp() { + return this.innerModel().registrationTimestamp(); + } + + public OffsetDateTime lastSyncTimestamp() { + return this.innerModel().lastSyncTimestamp(); + } + + public OffsetDateTime lastBillingTimestamp() { + return this.innerModel().lastBillingTimestamp(); + } + + public String serviceEndpoint() { + return this.innerModel().serviceEndpoint(); + } + + public String resourceProviderObjectId() { + return this.innerModel().resourceProviderObjectId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ClusterPatch updateCluster; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createWithResponse(resourceGroupName, clusterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Cluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createWithResponse(resourceGroupName, clusterName, this.innerModel(), context) + .getValue(); + return this; + } + + ClusterImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateCluster = new ClusterPatch(); + return this; + } + + public Cluster apply() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .updateWithResponse(resourceGroupName, clusterName, updateCluster, Context.NONE) + .getValue(); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .updateWithResponse(resourceGroupName, clusterName, updateCluster, context) + .getValue(); + return this; + } + + ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity() { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName); + } + + public ClusterIdentityResponse createIdentity(Context context) { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); + } + + public Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return serviceManager.clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + } + + public Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return serviceManager.clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCluster.withTags(tags); + return this; + } + } + + public ClusterImpl withTypeIdentityType(ManagedServiceIdentityType typeIdentityType) { + this.innerModel().withTypeIdentityType(typeIdentityType); + return this; + } + + public ClusterImpl withUserAssignedIdentities(Map userAssignedIdentities) { + if (isInCreateMode()) { + this.innerModel().withUserAssignedIdentities(userAssignedIdentities); + return this; + } else { + this.updateCluster.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + } + + public ClusterImpl withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (isInCreateMode()) { + this.innerModel().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } else { + this.updateCluster.withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } + } + + public ClusterImpl withAadClientId(String aadClientId) { + if (isInCreateMode()) { + this.innerModel().withAadClientId(aadClientId); + return this; + } else { + this.updateCluster.withAadClientId(aadClientId); + return this; + } + } + + public ClusterImpl withAadTenantId(String aadTenantId) { + if (isInCreateMode()) { + this.innerModel().withAadTenantId(aadTenantId); + return this; + } else { + this.updateCluster.withAadTenantId(aadTenantId); + return this; + } + } + + public ClusterImpl withAadApplicationObjectId(String aadApplicationObjectId) { + this.innerModel().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.innerModel().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + + public ClusterImpl withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.innerModel().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (isInCreateMode()) { + this.innerModel().withDesiredProperties(desiredProperties); + return this; + } else { + this.updateCluster.withDesiredProperties(desiredProperties); + return this; + } + } + + public ClusterImpl withType(ManagedServiceIdentityType type) { + this.updateCluster.withType(type); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..0fe7aef89690 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java @@ -0,0 +1,1792 @@ +// Copyright (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.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import com.azure.resourcemanager.azurestackhci.models.ClusterList; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ +public final class ClustersClientImpl implements ClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClustersService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientC") + public interface ClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ClusterInner cluster, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ClusterPatch cluster, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> uploadCertificate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UploadCertificateRequest uploadCertificateRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> extendSoftwareAssuranceBenefit(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all HCI clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all HCI clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all HCI clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all HCI clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all HCI clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all HCI clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters 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)); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { + if (this.client.getEndpoint() == null) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + } + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String clusterName, + ClusterInner cluster) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), cluster, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> createWithResponseAsync(String resourceGroupName, String clusterName, + ClusterInner cluster, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), cluster, accept, context); + } + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String clusterName, ClusterInner cluster) { + return createWithResponseAsync(resourceGroupName, clusterName, cluster) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String clusterName, ClusterInner cluster, + Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + } + + /** + * Create an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { + return createWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); + } + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterPatch cluster) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), cluster, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterPatch cluster, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), cluster, accept, context); + } + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, ClusterPatch cluster) { + return updateWithResponseAsync(resourceGroupName, clusterName, cluster) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String clusterName, ClusterPatch cluster, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + } + + /** + * Update an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { + return updateWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> uploadCertificateWithResponseAsync(String resourceGroupName, + String clusterName, UploadCertificateRequest uploadCertificateRequest) { + 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 (uploadCertificateRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.uploadCertificate(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), + uploadCertificateRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> uploadCertificateWithResponseAsync(String resourceGroupName, + String clusterName, UploadCertificateRequest uploadCertificateRequest, 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 (uploadCertificateRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.uploadCertificate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), uploadCertificateRequest, accept, context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginUploadCertificateAsync(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest) { + Mono>> mono + = uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginUploadCertificateAsync(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginUploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest) { + return this.beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest) + .getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginUploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context) { + return this.beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + .getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 uploadCertificateAsync(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 uploadCertificateAsync(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).block(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> + beginCreateIdentityAsync(String resourceGroupName, String clusterName) { + Mono>> mono = createIdentityWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ClusterIdentityResponseInner.class, ClusterIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> + beginCreateIdentityAsync(String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createIdentityWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ClusterIdentityResponseInner.class, ClusterIdentityResponseInner.class, + context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName) { + return this.beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> + beginCreateIdentity(String resourceGroupName, String clusterName, Context context) { + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName, + Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName) { + return createIdentityAsync(resourceGroupName, clusterName).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context) { + return createIdentityAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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>> extendSoftwareAssuranceBenefitWithResponseAsync(String resourceGroupName, + String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + 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 (softwareAssuranceChangeRequest == null) { + return Mono.error(new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.extendSoftwareAssuranceBenefit(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), + softwareAssuranceChangeRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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>> extendSoftwareAssuranceBenefitWithResponseAsync(String resourceGroupName, + String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, 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 (softwareAssuranceChangeRequest == null) { + return Mono.error(new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.extendSoftwareAssuranceBenefit(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), softwareAssuranceChangeRequest, accept, + context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + Mono>> mono = extendSoftwareAssuranceBenefitWithResponseAsync(resourceGroupName, + clusterName, softwareAssuranceChangeRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = extendSoftwareAssuranceBenefitWithResponseAsync(resourceGroupName, + clusterName, softwareAssuranceChangeRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterInner.class, ClusterInner.class, context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return this + .beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return this + .beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest, + context) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefitAsync(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefitAsync(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context) { + return beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return extendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .block(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context) { + return extendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest, + context).block(); + } + + /** + * 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 clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..65e96c549f1a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; + +public final class ClustersImpl implements Clusters { + private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName) { + ClusterIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context) { + ClusterIdentityResponseInner inner + = this.serviceClient().createIdentity(resourceGroupName, clusterName, context); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + ClusterInner inner = this.serviceClient() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context) { + ClusterInner inner = this.serviceClient() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest, 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) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java new file mode 100644 index 000000000000..3df5c0776c2b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingInner; +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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.ReportedProperties; +import java.util.Collections; +import java.util.List; + +public final class DeploymentSettingImpl + implements DeploymentSetting, DeploymentSetting.Definition, DeploymentSetting.Update { + private DeploymentSettingInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List arcNodeResourceIds() { + List inner = this.innerModel().arcNodeResourceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DeploymentMode deploymentMode() { + return this.innerModel().deploymentMode(); + } + + public DeploymentConfiguration deploymentConfiguration() { + return this.innerModel().deploymentConfiguration(); + } + + public ReportedProperties reportedProperties() { + return this.innerModel().reportedProperties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DeploymentSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String deploymentSettingsName; + + public DeploymentSettingImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public DeploymentSetting create() { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .createOrUpdate(resourceGroupName, clusterName, deploymentSettingsName, this.innerModel(), Context.NONE); + return this; + } + + public DeploymentSetting create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .createOrUpdate(resourceGroupName, clusterName, deploymentSettingsName, this.innerModel(), context); + return this; + } + + DeploymentSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new DeploymentSettingInner(); + this.serviceManager = serviceManager; + this.deploymentSettingsName = name; + } + + public DeploymentSettingImpl update() { + return this; + } + + public DeploymentSetting apply() { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .createOrUpdate(resourceGroupName, clusterName, deploymentSettingsName, this.innerModel(), Context.NONE); + return this; + } + + public DeploymentSetting apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .createOrUpdate(resourceGroupName, clusterName, deploymentSettingsName, this.innerModel(), context); + return this; + } + + DeploymentSettingImpl(DeploymentSettingInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.deploymentSettingsName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deploymentSettings"); + } + + public DeploymentSetting refresh() { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, Context.NONE) + .getValue(); + return this; + } + + public DeploymentSetting refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDeploymentSettings() + .getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, context) + .getValue(); + return this; + } + + public DeploymentSettingImpl withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public DeploymentSettingImpl withArcNodeResourceIds(List arcNodeResourceIds) { + this.innerModel().withArcNodeResourceIds(arcNodeResourceIds); + return this; + } + + public DeploymentSettingImpl withDeploymentMode(DeploymentMode deploymentMode) { + this.innerModel().withDeploymentMode(deploymentMode); + 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/DeploymentSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsClientImpl.java new file mode 100644 index 000000000000..2b69d37bb381 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsClientImpl.java @@ -0,0 +1,930 @@ +// Copyright (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.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.DeploymentSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingInner; +import com.azure.resourcemanager.azurestackhci.models.DeploymentSettingListResult; +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 DeploymentSettingsClient. + */ +public final class DeploymentSettingsClientImpl implements DeploymentSettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DeploymentSettingsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of DeploymentSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentSettingsClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(DeploymentSettingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientDeploymentSettings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientD") + public interface DeploymentSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusters(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("deploymentSettingsName") String deploymentSettingsName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("deploymentSettingsName") String deploymentSettingsName, + @BodyParam("application/json") DeploymentSettingInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("deploymentSettingsName") String deploymentSettingsName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClustersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersSinglePageAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByClusters(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersSinglePageAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusters(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClustersAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClustersSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClustersNextSinglePageAsync(nextLink)); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClustersAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listByClustersSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClustersNextSinglePageAsync(nextLink, context)); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusters(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClustersAsync(resourceGroupName, clusterName)); + } + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusters(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(listByClustersAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DeploymentSetting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName) { + 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, deploymentSettingsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DeploymentSetting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName, 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, deploymentSettingsName, accept, context); + } + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DeploymentSetting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName) { + return getWithResponseAsync(resourceGroupName, clusterName, deploymentSettingsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DeploymentSetting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, deploymentSettingsName, context).block(); + } + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DeploymentSetting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentSettingInner get(String resourceGroupName, String clusterName, String deploymentSettingsName) { + return getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, Context.NONE).getValue(); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String deploymentSettingsName, DeploymentSettingInner resource) { + 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, deploymentSettingsName, resource, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String deploymentSettingsName, DeploymentSettingInner resource, 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, deploymentSettingsName, resource, accept, + context); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentSettingInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String deploymentSettingsName, DeploymentSettingInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, deploymentSettingsName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentSettingInner.class, DeploymentSettingInner.class, + this.client.getContext()); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentSettingInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String deploymentSettingsName, DeploymentSettingInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, + deploymentSettingsName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentSettingInner.class, DeploymentSettingInner.class, context); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentSettingInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String deploymentSettingsName, DeploymentSettingInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource) + .getSyncPoller(); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentSettingInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String deploymentSettingsName, DeploymentSettingInner resource, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource, context) + .getSyncPoller(); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName, DeploymentSettingInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName, DeploymentSettingInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentSettingInner createOrUpdate(String resourceGroupName, String clusterName, + String deploymentSettingsName, DeploymentSettingInner resource) { + return createOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource).block(); + } + + /** + * Create a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentSettingInner createOrUpdate(String resourceGroupName, String clusterName, + String deploymentSettingsName, DeploymentSettingInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, deploymentSettingsName, resource, context).block(); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName) { + 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, deploymentSettingsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName, 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 (deploymentSettingsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter deploymentSettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, deploymentSettingsName, accept, context); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, deploymentSettingsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, deploymentSettingsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String deploymentSettingsName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, deploymentSettingsName).getSyncPoller(); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, deploymentSettingsName, context).getSyncPoller(); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String deploymentSettingsName) { + return beginDeleteAsync(resourceGroupName, clusterName, deploymentSettingsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String deploymentSettingsName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, deploymentSettingsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String deploymentSettingsName) { + deleteAsync(resourceGroupName, clusterName, deploymentSettingsName).block(); + } + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String deploymentSettingsName, Context context) { + deleteAsync(resourceGroupName, clusterName, deploymentSettingsName, context).block(); + } + + /** + * 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 of a DeploymentSetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersNextSinglePageAsync(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.listByClustersNext(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 of a DeploymentSetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersNextSinglePageAsync(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.listByClustersNext(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/DeploymentSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java new file mode 100644 index 000000000000..67cf3f75119c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/DeploymentSettingsImpl.java @@ -0,0 +1,159 @@ +// Copyright (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.DeploymentSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingInner; +import com.azure.resourcemanager.azurestackhci.models.DeploymentSetting; +import com.azure.resourcemanager.azurestackhci.models.DeploymentSettings; + +public final class DeploymentSettingsImpl implements DeploymentSettings { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentSettingsImpl.class); + + private final DeploymentSettingsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public DeploymentSettingsImpl(DeploymentSettingsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByClusters(String resourceGroupName, String clusterName) { + PagedIterable inner + = this.serviceClient().listByClusters(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentSettingImpl(inner1, this.manager())); + } + + public PagedIterable listByClusters(String resourceGroupName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().listByClusters(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentSettingImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeploymentSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentSetting get(String resourceGroupName, String clusterName, String deploymentSettingsName) { + DeploymentSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, deploymentSettingsName); + if (inner != null) { + return new DeploymentSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String deploymentSettingsName) { + this.serviceClient().delete(resourceGroupName, clusterName, deploymentSettingsName); + } + + public void delete(String resourceGroupName, String clusterName, String deploymentSettingsName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, deploymentSettingsName, context); + } + + public DeploymentSetting 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String deploymentSettingsName = ResourceManagerUtils.getValueFromIdByName(id, "deploymentSettings"); + if (deploymentSettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deploymentSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String deploymentSettingsName = ResourceManagerUtils.getValueFromIdByName(id, "deploymentSettings"); + if (deploymentSettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deploymentSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, deploymentSettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String deploymentSettingsName = ResourceManagerUtils.getValueFromIdByName(id, "deploymentSettings"); + if (deploymentSettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deploymentSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, deploymentSettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String deploymentSettingsName = ResourceManagerUtils.getValueFromIdByName(id, "deploymentSettings"); + if (deploymentSettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deploymentSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, deploymentSettingsName, context); + } + + private DeploymentSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public DeploymentSettingImpl define(String name) { + return new DeploymentSettingImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..41844602ffb0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDeviceImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; +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, EdgeDevice.Definition, EdgeDevice.Update { + private EdgeDeviceInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public 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() { + 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/EdgeDevicesClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesClientImpl.java new file mode 100644 index 000000000000..b3dfafbabc60 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesClientImpl.java @@ -0,0 +1,1034 @@ +// Copyright (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.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.EdgeDevicesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; +import com.azure.resourcemanager.azurestackhci.models.EdgeDeviceListResult; +import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; +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 EdgeDevicesClient. + */ +public final class EdgeDevicesClientImpl implements EdgeDevicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EdgeDevicesService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of EdgeDevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeDevicesClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(EdgeDevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientEdgeDevices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientE") + public interface EdgeDevicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("edgeDeviceName") String edgeDeviceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("edgeDeviceName") String edgeDeviceName, @BodyParam("application/json") EdgeDeviceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("edgeDeviceName") String edgeDeviceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/validate") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("edgeDeviceName") String edgeDeviceName, + @BodyParam("application/json") ValidateRequest validateRequest, @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); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation 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(), this.client.getApiVersion(), resourceUri, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation 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(), this.client.getApiVersion(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation 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)); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 EdgeDevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, String edgeDeviceName) { + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + edgeDeviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 EdgeDevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, String edgeDeviceName, + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, edgeDeviceName, accept, + context); + } + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 EdgeDevice on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri, String edgeDeviceName) { + return getWithResponseAsync(resourceUri, edgeDeviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 EdgeDevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, String edgeDeviceName, Context context) { + return getWithResponseAsync(resourceUri, edgeDeviceName, context).block(); + } + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 EdgeDevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeDeviceInner get(String resourceUri, String edgeDeviceName) { + return getWithResponse(resourceUri, edgeDeviceName, Context.NONE).getValue(); + } + + /** + * Create 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String edgeDeviceName, + EdgeDeviceInner resource) { + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, edgeDeviceName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String edgeDeviceName, + EdgeDeviceInner resource, 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + edgeDeviceName, resource, accept, context); + } + + /** + * Create 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 ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeDeviceInner> beginCreateOrUpdateAsync(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, edgeDeviceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EdgeDeviceInner.class, EdgeDeviceInner.class, this.client.getContext()); + } + + /** + * Create 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 ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeDeviceInner> beginCreateOrUpdateAsync(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceUri, edgeDeviceName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EdgeDeviceInner.class, EdgeDeviceInner.class, context); + } + + /** + * Create 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 ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeDeviceInner> beginCreateOrUpdate(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource) { + return this.beginCreateOrUpdateAsync(resourceUri, edgeDeviceName, resource).getSyncPoller(); + } + + /** + * Create 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 ManagementException thrown 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 edge device resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeDeviceInner> beginCreateOrUpdate(String resourceUri, + String edgeDeviceName, EdgeDeviceInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceUri, edgeDeviceName, resource, context).getSyncPoller(); + } + + /** + * Create 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri, String edgeDeviceName, + EdgeDeviceInner resource) { + return beginCreateOrUpdateAsync(resourceUri, edgeDeviceName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri, String edgeDeviceName, + EdgeDeviceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceUri, edgeDeviceName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeDeviceInner createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource) { + return createOrUpdateAsync(resourceUri, edgeDeviceName, resource).block(); + } + + /** + * Create 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeDeviceInner createOrUpdate(String resourceUri, String edgeDeviceName, EdgeDeviceInner resource, + Context context) { + return createOrUpdateAsync(resourceUri, edgeDeviceName, resource, context).block(); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName) { + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + edgeDeviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName, + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, edgeDeviceName, + accept, context); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName) { + Mono>> mono = deleteWithResponseAsync(resourceUri, edgeDeviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, edgeDeviceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName) { + return this.beginDeleteAsync(resourceUri, edgeDeviceName).getSyncPoller(); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, String edgeDeviceName, Context context) { + return this.beginDeleteAsync(resourceUri, edgeDeviceName, context).getSyncPoller(); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, String edgeDeviceName) { + return beginDeleteAsync(resourceUri, edgeDeviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, String edgeDeviceName, Context context) { + return beginDeleteAsync(resourceUri, edgeDeviceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, String edgeDeviceName) { + deleteAsync(resourceUri, edgeDeviceName).block(); + } + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, String edgeDeviceName, Context context) { + deleteAsync(resourceUri, edgeDeviceName, context).block(); + } + + /** + * 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 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync(String resourceUri, String edgeDeviceName, + ValidateRequest validateRequest) { + 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + if (validateRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateRequest is required and cannot be null.")); + } else { + validateRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, edgeDeviceName, validateRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync(String resourceUri, String edgeDeviceName, + ValidateRequest validateRequest, 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 (edgeDeviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeDeviceName is required and cannot be null.")); + } + if (validateRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateRequest is required and cannot be null.")); + } else { + validateRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, edgeDeviceName, + validateRequest, accept, context); + } + + /** + * 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 ManagementException thrown 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 an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateResponseInner> beginValidateAsync(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest) { + Mono>> mono = validateWithResponseAsync(resourceUri, edgeDeviceName, validateRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateResponseInner.class, ValidateResponseInner.class, + this.client.getContext()); + } + + /** + * 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 ManagementException thrown 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 an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateResponseInner> beginValidateAsync(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = validateWithResponseAsync(resourceUri, edgeDeviceName, validateRequest, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateResponseInner.class, ValidateResponseInner.class, context); + } + + /** + * 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 ManagementException thrown 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 an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateResponseInner> beginValidate(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest) { + return this.beginValidateAsync(resourceUri, edgeDeviceName, validateRequest).getSyncPoller(); + } + + /** + * 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 ManagementException thrown 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 an Accepted response with an Operation-Location header. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateResponseInner> beginValidate(String resourceUri, + String edgeDeviceName, ValidateRequest validateRequest, Context context) { + return this.beginValidateAsync(resourceUri, edgeDeviceName, validateRequest, context).getSyncPoller(); + } + + /** + * 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync(String resourceUri, String edgeDeviceName, + ValidateRequest validateRequest) { + return beginValidateAsync(resourceUri, edgeDeviceName, validateRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync(String resourceUri, String edgeDeviceName, + ValidateRequest validateRequest, Context context) { + return beginValidateAsync(resourceUri, edgeDeviceName, validateRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateResponseInner validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest) { + return validateAsync(resourceUri, edgeDeviceName, validateRequest).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateResponseInner validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, + Context context) { + return validateAsync(resourceUri, edgeDeviceName, validateRequest, context).block(); + } + + /** + * 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 of a EdgeDevice list operation 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 of a EdgeDevice list operation 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/EdgeDevicesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java new file mode 100644 index 000000000000..c84b7d6abd02 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/EdgeDevicesImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.EdgeDevicesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; +import com.azure.resourcemanager.azurestackhci.models.EdgeDevice; +import com.azure.resourcemanager.azurestackhci.models.EdgeDevices; +import com.azure.resourcemanager.azurestackhci.models.ValidateRequest; +import com.azure.resourcemanager.azurestackhci.models.ValidateResponse; + +public final class EdgeDevicesImpl implements EdgeDevices { + private static final ClientLogger LOGGER = new ClientLogger(EdgeDevicesImpl.class); + + private final EdgeDevicesClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public EdgeDevicesImpl(EdgeDevicesClient 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 EdgeDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeDeviceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, String edgeDeviceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, edgeDeviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EdgeDeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EdgeDevice get(String resourceUri, String edgeDeviceName) { + EdgeDeviceInner inner = this.serviceClient().get(resourceUri, edgeDeviceName); + if (inner != null) { + return new EdgeDeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceUri, String edgeDeviceName) { + this.serviceClient().delete(resourceUri, edgeDeviceName); + } + + public void delete(String resourceUri, String edgeDeviceName, Context context) { + this.serviceClient().delete(resourceUri, edgeDeviceName, context); + } + + public ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest) { + ValidateResponseInner inner = this.serviceClient().validate(resourceUri, edgeDeviceName, validateRequest); + if (inner != null) { + return new ValidateResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, + Context context) { + ValidateResponseInner inner + = this.serviceClient().validate(resourceUri, edgeDeviceName, validateRequest, context); + if (inner != null) { + return new ValidateResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + 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() { + 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 new file mode 100644 index 000000000000..4e2708793046 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ExtensionManagedBy; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ExtensionImpl implements Extension, Extension.Definition, Extension.Update { + private ExtensionInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExtensionAggregateState aggregateState() { + return this.innerModel().aggregateState(); + } + + public List perNodeExtensionDetails() { + List inner = this.innerModel().perNodeExtensionDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtensionManagedBy managedBy() { + return this.innerModel().managedBy(); + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Object settings() { + return this.innerModel().settings(); + } + + public Object protectedSettings() { + return this.innerModel().protectedSettings(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String arcSettingName; + + private String extensionName; + + private ExtensionPatch updateExtension; + + public ExtensionImpl withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.arcSettingName = arcSettingName; + return this; + } + + public Extension create() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); + return this; + } + + public Extension create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); + return this; + } + + ExtensionImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new ExtensionInner(); + this.serviceManager = serviceManager; + this.extensionName = name; + } + + public ExtensionImpl update() { + this.updateExtension = new ExtensionPatch(); + return this; + } + + public Extension apply() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .update(resourceGroupName, clusterName, arcSettingName, extensionName, updateExtension, Context.NONE); + return this; + } + + public Extension apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .update(resourceGroupName, clusterName, arcSettingName, extensionName, updateExtension, context); + return this; + } + + ExtensionImpl(ExtensionInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.arcSettingName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "arcSettings"); + this.extensionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public Extension refresh() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE) + .getValue(); + return this; + } + + public Extension refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context) + .getValue(); + return this; + } + + public void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters) { + serviceManager.extensions() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters); + } + + public void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters, Context context) { + serviceManager.extensions() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, + context); + } + + public ExtensionImpl withForceUpdateTag(String forceUpdateTag) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } + + public ExtensionImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public ExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public ExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + public ExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + public ExtensionImpl withSettings(Object settings) { + this.innerModel().withSettings(settings); + return this; + } + + public ExtensionImpl withProtectedSettings(Object protectedSettings) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } + + public ExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + public ExtensionImpl withExtensionParameters(ExtensionPatchParameters extensionParameters) { + this.updateExtension.withExtensionParameters(extensionParameters); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java new file mode 100644 index 000000000000..77c4b8f7dec1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -0,0 +1,1561 @@ +// Copyright (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.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.ExtensionList; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExtensionsClient. + */ +public final class ExtensionsClientImpl implements ExtensionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExtensionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of ExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionsClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientExtensions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientE") + public interface ExtensionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArcSetting(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ExtensionInner extension, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ExtensionPatch extension, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgrade(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExtensionUpgradeParameters extensionUpgradeParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArcSettingNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingSinglePageAsync(String resourceGroupName, + String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByArcSetting(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingSinglePageAsync(String resourceGroupName, + String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByArcSetting(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArcSettingAsync(String resourceGroupName, String clusterName, + String arcSettingName) { + return new PagedFlux<>(() -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName), + nextLink -> listByArcSettingNextSinglePageAsync(nextLink)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArcSettingAsync(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return new PagedFlux<>( + () -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName, context), + nextLink -> listByArcSettingNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArcSetting(String resourceGroupName, String clusterName, + String arcSettingName) { + return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArcSetting(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName, context)); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + arcSettingName, extensionName, this.client.getApiVersion(), accept, context); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE).getValue(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionInner extension) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, extensionName, this.client.getApiVersion(), extension, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionInner extension, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), extension, accept, context); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginCreateAsync(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionInner extension) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExtensionInner.class, ExtensionInner.class, this.client.getContext()); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginCreateAsync(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionInner extension, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, + extensionName, extension, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExtensionInner.class, ExtensionInner.class, context); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginCreate(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionInner extension) { + return this.beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .getSyncPoller(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginCreate(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionInner extension, Context context) { + return this.beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .getSyncPoller(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionInner extension) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionInner extension, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner create(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionInner extension) { + return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner create(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionInner extension, Context context) { + return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionPatch extension) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, extensionName, this.client.getApiVersion(), extension, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionPatch extension, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), extension, accept, context); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginUpdateAsync(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionPatch extension) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExtensionInner.class, ExtensionInner.class, this.client.getContext()); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginUpdateAsync(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionPatch extension, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, + extensionName, extension, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExtensionInner.class, ExtensionInner.class, context); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginUpdate(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionPatch extension) { + return this.beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .getSyncPoller(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginUpdate(String resourceGroupName, + String clusterName, String arcSettingName, String extensionName, ExtensionPatch extension, Context context) { + return this.beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .getSyncPoller(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionPatch extension) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionPatch extension, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner update(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionPatch extension) { + return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner update(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionPatch extension, Context context) { + return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).getSyncPoller(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context) + .getSyncPoller(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + Context context) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.upgrade(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, arcSettingName, extensionName, this.client.getApiVersion(), + extensionUpgradeParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.upgrade(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, arcSettingName, extensionName, this.client.getApiVersion(), extensionUpgradeParameters, accept, + context); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters) { + Mono>> mono = upgradeWithResponseAsync(resourceGroupName, clusterName, arcSettingName, + extensionName, extensionUpgradeParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeAsync(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = upgradeWithResponseAsync(resourceGroupName, clusterName, arcSettingName, + extensionName, extensionUpgradeParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgrade(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters) { + return this + .beginUpgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, + extensionUpgradeParameters) + .getSyncPoller(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgrade(String resourceGroupName, String clusterName, + String arcSettingName, String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + return this + .beginUpgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, + extensionUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters) { + return beginUpgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, + extensionUpgradeParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, ExtensionUpgradeParameters extensionUpgradeParameters, Context context) { + return beginUpgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, + extensionUpgradeParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + upgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters).block(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, Context context) { + upgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context) + .block(); + } + + /** + * 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 Extensions in HCI cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingNextSinglePageAsync(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.listByArcSettingNext(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 Extensions in HCI cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingNextSinglePageAsync(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.listByArcSettingNext(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/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java new file mode 100644 index 000000000000..996d03e65744 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.Extensions; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; + +public final class ExtensionsImpl implements Extensions { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionsImpl.class); + + private final ExtensionsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public ExtensionsImpl(ExtensionsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByArcSetting(String resourceGroupName, String clusterName, + String arcSettingName) { + PagedIterable inner + = this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + } + + public PagedIterable listByArcSetting(String resourceGroupName, String clusterName, + String arcSettingName, Context context) { + PagedIterable inner + = this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); + if (inner != null) { + return new ExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName); + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + public void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + this.serviceClient() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters); + } + + public void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, Context context) { + this.serviceClient() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, + context); + } + + public Extension 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = ResourceManagerUtils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + private ExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public ExtensionImpl define(String name) { + return new ExtensionImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryImagesImpl.java index 8bf29ac11b7e..ce43e7a72c71 100644 --- 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 @@ -11,10 +11,10 @@ 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.GalleryImageStatus; import com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest; +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; @@ -127,20 +127,16 @@ public GalleryImagesImpl withExistingResourceGroup(String resourceGroupName) { } public GalleryImages create() { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImagesOperations() - .createOrUpdate(resourceGroupName, galleryImageName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getGalleryImagesOperations() + .createOrUpdate(resourceGroupName, galleryImageName, this.innerModel(), context); return this; } @@ -156,48 +152,40 @@ public GalleryImagesImpl update() { } public GalleryImages apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImagesOperations() - .update(resourceGroupName, galleryImageName, updateGalleryImages, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getGalleryImagesOperations() + .update(resourceGroupName, galleryImageName, updateGalleryImages, context); return this; } - GalleryImagesImpl( - GalleryImagesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + GalleryImagesImpl(GalleryImagesInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.galleryImageName = Utils.getValueFromIdByName(innerObject.id(), "galleryImages"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, galleryImageName, context) + .getValue(); return this; } 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 index 9a81faad20ab..3017868aa26a 100644 --- 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 @@ -40,23 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GalleryImagesOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final GalleryImagesOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(GalleryImagesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -67,112 +72,84 @@ public final class GalleryImagesOperationsClientImpl implements GalleryImagesOpe @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}) + @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, + 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); + @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}) + @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, + 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, + @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}) + @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, + 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); + @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}) + @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, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, + @PathParam("galleryImageName") String galleryImageName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") GalleryImagesUpdateRequest galleryImages, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryImages") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. @@ -181,19 +158,15 @@ Mono> listAllNext( * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -206,22 +179,14 @@ private Mono> getByResourceGroupWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryImageName, - this.client.getApiVersion(), - accept, - context)) + 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. @@ -231,19 +196,15 @@ private Mono> getByResourceGroupWithResponseAsync( * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -255,20 +216,13 @@ private Mono> getByResourceGroupWithResponseAsync( } 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); + 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. @@ -284,7 +238,7 @@ private Mono getByResourceGroupAsync(String resourceGroupNam /** * 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. @@ -294,14 +248,14 @@ private Mono getByResourceGroupAsync(String resourceGroupNam * @return a gallery image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String galleryImageName, Context context) { + 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. @@ -317,30 +271,26 @@ public GalleryImagesInner getByResourceGroup(String resourceGroupName, String ga /** * The operation to create or update a gallery image. Please note some properties can be set only during gallery * image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -357,49 +307,35 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .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 gallery images resource definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -416,52 +352,38 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + 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 gallery images resource definition. + * @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()); + 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 gallery images resource definition. + * @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. @@ -472,39 +394,37 @@ private PollerFlux, GalleryImagesInner> beginCrea 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); + 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 gallery images resource definition. + * @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) { + 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 gallery images resource definition. + * @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. @@ -512,40 +432,38 @@ public SyncPoller, GalleryImagesInner> beginCreat * @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) + 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 gallery images resource definition. + * @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() + 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 gallery images resource definition. + * @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. @@ -553,38 +471,37 @@ private Mono createOrUpdateAsync( * @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() + 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 gallery images resource definition. + * @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) { + 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 gallery images resource definition. + * @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. @@ -592,14 +509,14 @@ public GalleryImagesInner createOrUpdate( * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImagesInner createOrUpdate( - String resourceGroupName, String galleryImageName, GalleryImagesInner galleryImages, Context context) { + 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. @@ -608,19 +525,15 @@ public GalleryImagesInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryImageName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -632,23 +545,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryImageName, - this.client.getApiVersion(), - accept, - context)) + .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. @@ -658,19 +562,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryImageName, Context context) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -682,20 +582,13 @@ private Mono>> deleteWithResponseAsync( } 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); + 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. @@ -706,15 +599,13 @@ private Mono>> deleteWithResponseAsync( @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()); + 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. @@ -724,18 +615,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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) { + 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); + 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. @@ -750,7 +640,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -760,14 +650,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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) { + 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. @@ -777,14 +667,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String galleryImageName) { - return beginDeleteAsync(resourceGroupName, galleryImageName) - .last() + 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. @@ -795,14 +684,13 @@ private Mono deleteAsync(String resourceGroupName, String galleryImageName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String galleryImageName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryImageName, context) - .last() + 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. @@ -816,7 +704,7 @@ public 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. @@ -831,30 +719,26 @@ public void delete(String resourceGroupName, String galleryImageName, Context co /** * The operation to update a gallery image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param galleryImageName Name of the gallery image. - * @param galleryImages The gallery images resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -871,48 +755,34 @@ private Mono>> updateWithResponseAsync( } 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)) + .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 gallery images resource patch definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -929,50 +799,36 @@ private Mono>> updateWithResponseAsync( } 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); + 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 gallery images resource patch definition. + * @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()); + 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 gallery images resource patch definition. + * @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. @@ -980,40 +836,38 @@ private PollerFlux, GalleryImagesInner> beginUpda * @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) { + 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); + 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 gallery images resource patch definition. + * @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) { + 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 gallery images resource patch definition. + * @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. @@ -1021,36 +875,35 @@ public SyncPoller, GalleryImagesInner> beginUpdat * @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) { + 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 gallery images resource patch definition. + * @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() + 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 gallery images resource patch definition. + * @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. @@ -1058,36 +911,35 @@ private Mono updateAsync( * @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() + 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 gallery images resource patch definition. + * @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) { + 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 gallery images resource patch definition. + * @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. @@ -1095,15 +947,15 @@ public GalleryImagesInner update( * @return the gallery images resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImagesInner update( - String resourceGroupName, String galleryImageName, GalleryImagesUpdateRequest galleryImages, Context context) { + 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. @@ -1113,16 +965,12 @@ public GalleryImagesInner update( @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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1130,32 +978,17 @@ private Mono> listByResourceGroupSinglePageAsy } 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)) + .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. @@ -1164,19 +997,15 @@ private Mono> listByResourceGroupSinglePageAsy * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1185,28 +1014,16 @@ private Mono> listByResourceGroupSinglePageAsy 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)); + .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. @@ -1215,14 +1032,14 @@ private Mono> listByResourceGroupSinglePageAsy */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1232,15 +1049,14 @@ private PagedFlux listByResourceGroupAsync(String resourceGr */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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. @@ -1255,7 +1071,7 @@ public PagedIterable listByResourceGroup(String resourceGrou /** * 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. @@ -1271,7 +1087,7 @@ public PagedIterable listByResourceGroup(String resourceGrou /** * 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}. @@ -1279,44 +1095,26 @@ public PagedIterable listByResourceGroup(String resourceGrou @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.")); + 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.")); + 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)) + .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. @@ -1326,41 +1124,26 @@ private Mono> listSinglePageAsync() { @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1373,7 +1156,7 @@ private PagedFlux 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. @@ -1382,14 +1165,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1402,7 +1185,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1416,9 +1199,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1430,31 +1212,20 @@ private Mono> listNextSinglePageAsync(String n 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1467,31 +1238,20 @@ private Mono> listNextSinglePageAsync(String n 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1503,31 +1263,21 @@ private Mono> listAllNextSinglePageAsync(Strin 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1540,23 +1290,13 @@ private Mono> listAllNextSinglePageAsync(Strin 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.")); + 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)); + 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 index 9a34ef3484cc..444ba6d5dab1 100644 --- 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 @@ -21,22 +21,18 @@ public final class GalleryImagesOperationsImpl implements GalleryImagesOperation private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public GalleryImagesOperationsImpl( - GalleryImagesOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new GalleryImagesImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,96 +58,76 @@ public void delete(String resourceGroupName, String galleryImageName, Context co public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GalleryImagesImpl(inner1, this.manager())); } public GalleryImages getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, galleryImageName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, galleryImageName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); } this.delete(resourceGroupName, galleryImageName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryImages'.", id))); } this.delete(resourceGroupName, galleryImageName, context); } 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 index fbe30fe3331f..3fef803dcb65 100644 --- 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 @@ -15,8 +15,8 @@ public final class GuestAgentImpl implements GuestAgent { private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - GuestAgentImpl( - GuestAgentInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + GuestAgentImpl(GuestAgentInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index a3d3039baec5..bb7a35b92923 100644 --- 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 @@ -33,22 +33,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GuestAgentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final GuestAgentsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(GuestAgentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,48 +65,39 @@ public final class GuestAgentsClientImpl implements GuestAgentsClient { @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientG") public interface GuestAgentsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + 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); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") GuestAgentInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default") - @ExpectedResponses({202, 204}) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -110,10 +107,8 @@ Mono>> delete( @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.")); + 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.")); @@ -123,21 +118,18 @@ private Mono>> createWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) + .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. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,13 +138,11 @@ private Mono>> createWithResponseAsync(String resource * @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) { + 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.")); + 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.")); @@ -162,17 +152,17 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); + return service.create(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, + context); } /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -180,26 +170,20 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GuestAgentInner> beginCreateAsync( - String resourceUri, GuestAgentInner body) { + 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()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GuestAgentInner.class, GuestAgentInner.class, this.client.getContext()); } /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -209,23 +193,17 @@ private PollerFlux, GuestAgentInner> beginCreateAsyn 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()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GuestAgentInner.class, GuestAgentInner.class, this.client.getContext()); } /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -234,23 +212,21 @@ private PollerFlux, GuestAgentInner> beginCreateAsyn * @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) { + 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); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GuestAgentInner.class, GuestAgentInner.class, context); } /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -264,11 +240,11 @@ public SyncPoller, GuestAgentInner> beginCreate(Stri /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -277,18 +253,18 @@ public SyncPoller, GuestAgentInner> beginCreate(Stri * @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) { + 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. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -302,11 +278,11 @@ private Mono createAsync(String resourceUri, GuestAgentInner bo /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -320,11 +296,11 @@ private Mono createAsync(String resourceUri) { /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -339,11 +315,11 @@ private Mono createAsync(String resourceUri, GuestAgentInner bo /** * Implements GuestAgent PUT method. - * - *

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

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -376,11 +352,11 @@ public GuestAgentInner create(String resourceUri, GuestAgentInner body, Context /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -389,29 +365,26 @@ public GuestAgentInner create(String resourceUri, GuestAgentInner body, Context @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.")); + 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)) + .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. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -421,10 +394,8 @@ private Mono> getWithResponseAsync(String resourceUri) @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.")); + 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.")); @@ -436,11 +407,11 @@ private Mono> getWithResponseAsync(String resourceUri, /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -453,11 +424,11 @@ private Mono getAsync(String resourceUri) { /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -471,11 +442,11 @@ public Response getWithResponse(String resourceUri, Context con /** * Gets GuestAgent. - * - *

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

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -501,30 +472,26 @@ public GuestAgentInner get(String resourceUri) { @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.")); + 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)) + .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. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -534,10 +501,8 @@ private Mono>> deleteWithResponseAsync(String resource @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.")); + 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.")); @@ -549,11 +514,11 @@ private Mono>> deleteWithResponseAsync(String resource /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -562,19 +527,17 @@ private Mono>> deleteWithResponseAsync(String resource @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()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -585,18 +548,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceUri) 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); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -609,11 +571,11 @@ public SyncPoller, Void> beginDelete(String resourceUri) { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -627,11 +589,11 @@ public SyncPoller, Void> beginDelete(String resourceUri, Contex /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -644,11 +606,11 @@ private Mono deleteAsync(String resourceUri) { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -662,11 +624,11 @@ private Mono deleteAsync(String resourceUri, Context context) { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -678,11 +640,11 @@ public void delete(String resourceUri) { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. 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 index 9e73baba2656..aeb6c16b20e5 100644 --- 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 @@ -20,8 +20,8 @@ public final class GuestAgentsImpl implements GuestAgents { private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public GuestAgentsImpl( - GuestAgentsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + public GuestAgentsImpl(GuestAgentsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -47,10 +47,7 @@ public GuestAgent create(String resourceUri, GuestAgentInner body, Context conte 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new GuestAgentImpl(inner.getValue(), this.manager())); } else { return null; 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 index 85442299b69f..532094ff63d9 100644 --- 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 @@ -30,23 +30,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final GuestAgentsOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(GuestAgentsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,35 +62,29 @@ public final class GuestAgentsOperationsClientImpl implements GuestAgentsOperati @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientG") public interface GuestAgentsOperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + 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. - * + * + * 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. + * 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. @@ -94,38 +93,28 @@ Mono> listNext( @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.")); + 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)) + .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. - * + * + * 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. + * 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. @@ -135,36 +124,26 @@ private Mono> listSinglePageAsync(String resource @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.")); + 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)); + 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. - * + * + * 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. + * 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. @@ -177,11 +156,11 @@ private PagedFlux listAsync(String resourceUri) { /** * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given 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. + * 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. @@ -190,17 +169,17 @@ private PagedFlux listAsync(String resourceUri) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceUri, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, 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. - * + * + * 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. + * 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. @@ -213,11 +192,11 @@ public PagedIterable list(String resourceUri) { /** * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given 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. + * 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. @@ -231,9 +210,8 @@ public PagedIterable list(String resourceUri, Context context) /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -245,31 +223,20 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -282,23 +249,13 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)); + 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 index 18c2360cc8e9..93ceb2221824 100644 --- 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 @@ -19,8 +19,7 @@ public final class GuestAgentsOperationsImpl implements GuestAgentsOperations { private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public GuestAgentsOperationsImpl( - GuestAgentsOperationsClient innerClient, + public GuestAgentsOperationsImpl(GuestAgentsOperationsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public GuestAgentsOperationsImpl( public PagedIterable list(String resourceUri) { PagedIterable inner = this.serviceClient().list(resourceUri); - return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); } private GuestAgentsOperationsClient serviceClient() { 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 new file mode 100644 index 000000000000..33a21d035448 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java @@ -0,0 +1,364 @@ +// Copyright (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.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class HciUpdateImpl implements HciUpdate, HciUpdate.Definition, HciUpdate.Update { + private HciUpdateInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime installedDate() { + return this.innerModel().installedDate(); + } + + public String description() { + return this.innerModel().description(); + } + + public State state() { + return this.innerModel().state(); + } + + public List prerequisites() { + List inner = this.innerModel().prerequisites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List componentVersions() { + List inner = this.innerModel().componentVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RebootRequirement rebootRequired() { + return this.innerModel().rebootRequired(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public String packagePath() { + return this.innerModel().packagePath(); + } + + public Float packageSizeInMb() { + return this.innerModel().packageSizeInMb(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String version() { + return this.innerModel().version(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String releaseLink() { + return this.innerModel().releaseLink(); + } + + public AvailabilityType availabilityType() { + return this.innerModel().availabilityType(); + } + + public String packageType() { + return this.innerModel().packageType(); + } + + public String additionalProperties() { + return this.innerModel().additionalProperties(); + } + + public Float progressPercentage() { + return this.innerModel().progressPercentage(); + } + + public String notifyMessage() { + return this.innerModel().notifyMessage(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HciUpdateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + public HciUpdateImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public HciUpdate create() { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HciUpdate create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + HciUpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new HciUpdateInner(); + this.serviceManager = serviceManager; + this.updateName = name; + } + + public HciUpdateImpl update() { + return this; + } + + public HciUpdate apply() { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HciUpdate apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + HciUpdateImpl(HciUpdateInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "updates"); + } + + public HciUpdate refresh() { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE) + .getValue(); + return this; + } + + public HciUpdate refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, context) + .getValue(); + return this; + } + + public void post() { + serviceManager.updates().post(resourceGroupName, clusterName, updateName); + } + + public void post(Context context) { + serviceManager.updates().post(resourceGroupName, clusterName, updateName, context); + } + + public HciUpdateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HciUpdateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HciUpdateImpl withInstalledDate(OffsetDateTime installedDate) { + this.innerModel().withInstalledDate(installedDate); + return this; + } + + public HciUpdateImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public HciUpdateImpl withState(State state) { + this.innerModel().withState(state); + return this; + } + + public HciUpdateImpl withPrerequisites(List prerequisites) { + this.innerModel().withPrerequisites(prerequisites); + return this; + } + + public HciUpdateImpl withComponentVersions(List componentVersions) { + this.innerModel().withComponentVersions(componentVersions); + return this; + } + + public HciUpdateImpl withRebootRequired(RebootRequirement rebootRequired) { + this.innerModel().withRebootRequired(rebootRequired); + return this; + } + + public HciUpdateImpl withHealthState(HealthState healthState) { + this.innerModel().withHealthState(healthState); + return this; + } + + public HciUpdateImpl withHealthCheckResult(List healthCheckResult) { + this.innerModel().withHealthCheckResult(healthCheckResult); + return this; + } + + public HciUpdateImpl withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.innerModel().withHealthCheckDate(healthCheckDate); + return this; + } + + public HciUpdateImpl withPackagePath(String packagePath) { + this.innerModel().withPackagePath(packagePath); + return this; + } + + public HciUpdateImpl withPackageSizeInMb(Float packageSizeInMb) { + this.innerModel().withPackageSizeInMb(packageSizeInMb); + return this; + } + + public HciUpdateImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public HciUpdateImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public HciUpdateImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public HciUpdateImpl withReleaseLink(String releaseLink) { + this.innerModel().withReleaseLink(releaseLink); + return this; + } + + public HciUpdateImpl withAvailabilityType(AvailabilityType availabilityType) { + this.innerModel().withAvailabilityType(availabilityType); + return this; + } + + public HciUpdateImpl withPackageType(String packageType) { + this.innerModel().withPackageType(packageType); + return this; + } + + public HciUpdateImpl withAdditionalProperties(String additionalProperties) { + this.innerModel().withAdditionalProperties(additionalProperties); + return this; + } + + public HciUpdateImpl withProgressPercentage(Float progressPercentage) { + this.innerModel().withProgressPercentage(progressPercentage); + return this; + } + + public HciUpdateImpl withNotifyMessage(String notifyMessage) { + this.innerModel().withNotifyMessage(notifyMessage); + 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 index ec64a1173c03..fd0f5433e610 100644 --- 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 @@ -14,8 +14,7 @@ public final class HybridIdentityMetadataImpl implements HybridIdentityMetadata private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - HybridIdentityMetadataImpl( - HybridIdentityMetadataInner innerObject, + HybridIdentityMetadataImpl(HybridIdentityMetadataInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 764f508fc1d2..541eea7c9b6d 100644 --- 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 @@ -30,23 +30,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final HybridIdentityMetadatasService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(HybridIdentityMetadatasService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,47 +62,38 @@ public final class HybridIdentityMetadatasClientImpl implements HybridIdentityMe @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientH") public interface HybridIdentityMetadatasService { - @Headers({"Content-Type: application/json"}) - @Get( - "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default") - @ExpectedResponses({200}) + @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, + Mono> get(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -106,29 +102,26 @@ Mono> listNext( @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.")); + 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)) + .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. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -138,10 +131,8 @@ private Mono> getWithResponseAsync(String @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.")); + 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.")); @@ -153,11 +144,11 @@ private Mono> getWithResponseAsync(String /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -170,11 +161,11 @@ private Mono getAsync(String resourceUri) { /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -188,11 +179,11 @@ public Response getWithResponse(String resourceUri, /** * Gets HybridIdentityMetadata. - * - *

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

Returns the list of HybridIdentityMetadata of the given 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. + * 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. @@ -218,38 +209,28 @@ public HybridIdentityMetadataInner get(String resourceUri) { @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.")); + 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)) + .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. - * + * + * 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. + * 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. @@ -259,36 +240,26 @@ private Mono> listSinglePageAsync(Str @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.")); + 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)); + 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. - * + * + * 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. + * 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. @@ -301,11 +272,11 @@ private PagedFlux listAsync(String resourceUri) { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. @@ -314,17 +285,17 @@ private PagedFlux listAsync(String resourceUri) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceUri, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, 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. - * + * + * 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. + * 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. @@ -337,11 +308,11 @@ public PagedIterable list(String resourceUri) { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. @@ -355,9 +326,8 @@ public PagedIterable list(String resourceUri, Conte /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -369,31 +339,20 @@ private Mono> listNextSinglePageAsync 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -406,23 +365,13 @@ private Mono> listNextSinglePageAsync 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.")); + 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)); + 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 index 4220582fd36d..402eb800d224 100644 --- 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 @@ -21,8 +21,7 @@ public final class HybridIdentityMetadatasImpl implements HybridIdentityMetadata private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public HybridIdentityMetadatasImpl( - HybridIdentityMetadatasClient innerClient, + public HybridIdentityMetadatasImpl(HybridIdentityMetadatasClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,10 +30,7 @@ public HybridIdentityMetadatasImpl( 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new HybridIdentityMetadataImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,12 +48,12 @@ public HybridIdentityMetadata get(String resourceUri) { public PagedIterable list(String resourceUri) { PagedIterable inner = this.serviceClient().list(resourceUri); - return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); } private HybridIdentityMetadatasClient serviceClient() { 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 index aae244b6f701..acaf3c79573a 100644 --- 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 @@ -10,8 +10,8 @@ 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.LogicalNetworkStatus; import com.azure.resourcemanager.azurestackhci.models.LogicalNetworksUpdateRequest; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; import com.azure.resourcemanager.azurestackhci.models.Subnet; @@ -114,20 +114,16 @@ public LogicalNetworksImpl withExistingResourceGroup(String resourceGroupName) { } public LogicalNetworks create() { - this.innerObject = - serviceManager - .serviceClient() - .getLogicalNetworksOperations() - .createOrUpdate(resourceGroupName, logicalNetworkName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .createOrUpdate(resourceGroupName, logicalNetworkName, this.innerModel(), context); return this; } @@ -143,48 +139,40 @@ public LogicalNetworksImpl update() { } public LogicalNetworks apply() { - this.innerObject = - serviceManager - .serviceClient() - .getLogicalNetworksOperations() - .update(resourceGroupName, logicalNetworkName, updateLogicalNetworks, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .update(resourceGroupName, logicalNetworkName, updateLogicalNetworks, context); return this; } - LogicalNetworksImpl( - LogicalNetworksInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + LogicalNetworksImpl(LogicalNetworksInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.logicalNetworkName = Utils.getValueFromIdByName(innerObject.id(), "logicalNetworks"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getLogicalNetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, logicalNetworkName, context) + .getValue(); return this; } 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 index 64646c8b705b..d00f1ef570c1 100644 --- 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 @@ -40,24 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in LogicalNetworksOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final LogicalNetworksOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(LogicalNetworksOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -68,134 +72,103 @@ public final class LogicalNetworksOperationsClientImpl implements LogicalNetwork @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}) + @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, + 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); + @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}) + @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, + 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, + @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}) + @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, + 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); + @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}) + @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, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("logicalNetworkName") String logicalNetworkName, - @QueryParam("api-version") String apiVersion, + @PathParam("logicalNetworkName") String logicalNetworkName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogicalNetworksUpdateRequest logicalNetworks, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/logicalNetworks") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -208,45 +181,33 @@ private Mono> getByResourceGroupWithResponseAsync final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - logicalNetworkName, - this.client.getApiVersion(), - accept, - context)) + 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -258,20 +219,13 @@ private Mono> getByResourceGroupWithResponseAsync } 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); + 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. @@ -287,7 +241,7 @@ private Mono getByResourceGroupAsync(String resourceGroupN /** * 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. @@ -297,14 +251,14 @@ private Mono getByResourceGroupAsync(String resourceGroupN * @return the logical network resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String logicalNetworkName, Context context) { + 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. @@ -320,30 +274,26 @@ public LogicalNetworksInner getByResourceGroup(String resourceGroupName, String /** * 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 logical network resource definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -361,49 +311,35 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .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 logical network resource definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -421,25 +357,17 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + 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 logical network resource definition. + * @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. @@ -448,25 +376,19 @@ private Mono>> createOrUpdateWithResponseAsync( @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()); + 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 logical network resource definition. + * @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. @@ -477,39 +399,37 @@ private PollerFlux, LogicalNetworksInner> begin 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); + 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 logical network resource definition. + * @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) { + 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 logical network resource definition. + * @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. @@ -519,38 +439,36 @@ public SyncPoller, LogicalNetworksInner> beginC @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) + 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 logical network resource definition. + * @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() + 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 logical network resource definition. + * @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. @@ -558,38 +476,37 @@ private Mono createOrUpdateAsync( * @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() + 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 logical network resource definition. + * @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) { + 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 logical network resource definition. + * @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. @@ -597,14 +514,14 @@ public LogicalNetworksInner createOrUpdate( * @return the logical network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LogicalNetworksInner createOrUpdate( - String resourceGroupName, String logicalNetworkName, LogicalNetworksInner logicalNetworks, Context context) { + 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. @@ -613,19 +530,15 @@ public LogicalNetworksInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String logicalNetworkName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -637,23 +550,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - logicalNetworkName, - this.client.getApiVersion(), - accept, - context)) + .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. @@ -663,19 +567,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String logicalNetworkName, Context context) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -687,20 +587,13 @@ private Mono>> deleteWithResponseAsync( } 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); + 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. @@ -711,15 +604,13 @@ private Mono>> deleteWithResponseAsync( @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()); + 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. @@ -729,18 +620,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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) { + 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); + 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. @@ -755,7 +645,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -765,14 +655,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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) { + 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. @@ -782,14 +672,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String logicalNetworkName) { - return beginDeleteAsync(resourceGroupName, logicalNetworkName) - .last() + 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. @@ -800,14 +689,13 @@ private Mono deleteAsync(String resourceGroupName, String logicalNetworkNa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String logicalNetworkName, Context context) { - return beginDeleteAsync(resourceGroupName, logicalNetworkName, context) - .last() + 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. @@ -821,7 +709,7 @@ public 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. @@ -836,30 +724,26 @@ public void delete(String resourceGroupName, String logicalNetworkName, 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 logical network resource patch definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -877,51 +761,34 @@ private Mono>> updateWithResponseAsync( } 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)) + .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 logical network resource patch definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -939,24 +806,16 @@ private Mono>> updateWithResponseAsync( } 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); + 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 logical network resource patch definition. + * @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. @@ -965,24 +824,18 @@ private Mono>> updateWithResponseAsync( @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()); + 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 logical network resource patch definition. + * @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. @@ -991,42 +844,38 @@ private PollerFlux, LogicalNetworksInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LogicalNetworksInner> beginUpdateAsync( - String resourceGroupName, - String logicalNetworkName, - LogicalNetworksUpdateRequest logicalNetworks, + 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); + 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 logical network resource patch definition. + * @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) { + 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 logical network resource patch definition. + * @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. @@ -1034,39 +883,35 @@ public SyncPoller, LogicalNetworksInner> beginU * @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) { + 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 logical network resource patch definition. + * @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() + 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 logical network resource patch definition. + * @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. @@ -1074,39 +919,35 @@ private Mono updateAsync( * @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() + 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 logical network resource patch definition. + * @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) { + 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 logical network resource patch definition. + * @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. @@ -1114,18 +955,15 @@ public LogicalNetworksInner update( * @return the logical network resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LogicalNetworksInner update( - String resourceGroupName, - String logicalNetworkName, - LogicalNetworksUpdateRequest logicalNetworks, - Context context) { + 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. @@ -1135,16 +973,12 @@ public LogicalNetworksInner update( @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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1152,32 +986,17 @@ private Mono> listByResourceGroupSinglePageA } 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)) + .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. @@ -1186,19 +1005,15 @@ private Mono> listByResourceGroupSinglePageA * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1207,28 +1022,16 @@ private Mono> listByResourceGroupSinglePageA 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)); + .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. @@ -1237,14 +1040,14 @@ private Mono> listByResourceGroupSinglePageA */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1254,15 +1057,14 @@ private PagedFlux listByResourceGroupAsync(String resource */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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. @@ -1277,7 +1079,7 @@ public PagedIterable listByResourceGroup(String resourceGr /** * 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. @@ -1293,7 +1095,7 @@ public PagedIterable listByResourceGroup(String resourceGr /** * 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}. @@ -1301,44 +1103,26 @@ public PagedIterable listByResourceGroup(String resourceGr @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.")); + 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.")); + 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)) + .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. @@ -1348,41 +1132,26 @@ private Mono> listSinglePageAsync() { @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1395,7 +1164,7 @@ private PagedFlux 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. @@ -1404,14 +1173,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1424,7 +1193,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1438,9 +1207,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1452,31 +1220,20 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1489,31 +1246,20 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1525,31 +1271,21 @@ private Mono> listAllNextSinglePageAsync(Str 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1562,23 +1298,13 @@ private Mono> listAllNextSinglePageAsync(Str 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.")); + 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)); + 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 index 3c1421450fb7..3d3cd6526813 100644 --- 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 @@ -21,22 +21,18 @@ public final class LogicalNetworksOperationsImpl implements LogicalNetworksOpera private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public LogicalNetworksOperationsImpl( - LogicalNetworksOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new LogicalNetworksImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,101 +58,77 @@ public void delete(String resourceGroupName, String logicalNetworkName, Context public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogicalNetworksImpl(inner1, this.manager())); } public LogicalNetworks getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String logicalNetworkName = Utils.getValueFromIdByName(id, "logicalNetworks"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String logicalNetworkName = Utils.getValueFromIdByName(id, "logicalNetworks"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String logicalNetworkName = Utils.getValueFromIdByName(id, "logicalNetworks"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String logicalNetworkName = Utils.getValueFromIdByName(id, "logicalNetworks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicalNetworks'.", id))); } this.delete(resourceGroupName, logicalNetworkName, context); } 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 index a2b1def6a4a6..373bd518e9c0 100644 --- 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 @@ -13,8 +13,8 @@ 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.MarketplaceGalleryImageStatus; import com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; @@ -124,25 +124,21 @@ public MarketplaceGalleryImagesImpl withExistingResourceGroup(String resourceGro } public MarketplaceGalleryImages create() { - this.innerObject = - serviceManager - .serviceClient() - .getMarketplaceGalleryImagesOperations() - .createOrUpdate(resourceGroupName, marketplaceGalleryImageName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getMarketplaceGalleryImagesOperations() + .createOrUpdate(resourceGroupName, marketplaceGalleryImageName, this.innerModel(), context); return this; } - MarketplaceGalleryImagesImpl( - String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + MarketplaceGalleryImagesImpl(String name, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = new MarketplaceGalleryImagesInner(); this.serviceManager = serviceManager; this.marketplaceGalleryImageName = name; @@ -154,49 +150,41 @@ public MarketplaceGalleryImagesImpl update() { } public MarketplaceGalleryImages apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMarketplaceGalleryImagesOperations() - .update(resourceGroupName, marketplaceGalleryImageName, updateMarketplaceGalleryImages, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getMarketplaceGalleryImagesOperations() + .update(resourceGroupName, marketplaceGalleryImageName, updateMarketplaceGalleryImages, context); return this; } - MarketplaceGalleryImagesImpl( - MarketplaceGalleryImagesInner innerObject, + MarketplaceGalleryImagesImpl(MarketplaceGalleryImagesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.marketplaceGalleryImageName = Utils.getValueFromIdByName(innerObject.id(), "marketplaceGalleryImages"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getMarketplaceGalleryImagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, context) + .getValue(); return this; } 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 index bc5a7428dce9..2d75c7cc9410 100644 --- 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 @@ -44,24 +44,24 @@ * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final MarketplaceGalleryImagesOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(MarketplaceGalleryImagesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -72,112 +72,87 @@ public final class MarketplaceGalleryImagesOperationsClientImpl implements Marke @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}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}") - @ExpectedResponses({202, 204}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. @@ -186,49 +161,35 @@ Mono> listAllNext( * @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) { + 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.")); + 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.")); + 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.")); + 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)) + 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. @@ -238,46 +199,33 @@ private Mono> getByResourceGroupWithResp * @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) { + 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.")); + 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.")); + 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.")); + 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); + 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. @@ -286,15 +234,15 @@ private Mono> getByResourceGroupWithResp * @return a marketplace gallery image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String marketplaceGalleryImageName) { + 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. @@ -304,14 +252,14 @@ private Mono getByResourceGroupAsync( * @return a marketplace gallery image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String marketplaceGalleryImageName, Context context) { + 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. @@ -320,145 +268,109 @@ public Response getByResourceGroupWithResponse( * @return a marketplace gallery image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MarketplaceGalleryImagesInner getByResourceGroup( - String resourceGroupName, String marketplaceGalleryImageName) { + 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 marketplace gallery image resource definition. + * @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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages) { + 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.")); + 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.")); + 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.")); + 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.")); + 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)) + .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 marketplace gallery image resource definition. + * @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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context) { + 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.")); + 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.")); + 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.")); + 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.")); + 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); + 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 marketplace gallery image resource definition. + * @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. @@ -466,29 +378,22 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MarketplaceGalleryImagesInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String marketplaceGalleryImageName, + 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()); + 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 marketplace gallery image resource definition. + * @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. @@ -497,32 +402,23 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MarketplaceGalleryImagesInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context) { + 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); + 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 marketplace gallery image resource definition. + * @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. @@ -530,21 +426,19 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, + String resourceGroupName, String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, 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 marketplace gallery image resource definition. + * @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. @@ -553,10 +447,8 @@ public SyncPoller, MarketplaceGalleryI */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MarketplaceGalleryImagesInner> beginCreateOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context) { + String resourceGroupName, String marketplaceGalleryImageName, + MarketplaceGalleryImagesInner marketplaceGalleryImages, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) .getSyncPoller(); @@ -565,32 +457,29 @@ public SyncPoller, MarketplaceGalleryI /** * The operation to create or update a marketplace gallery image. Please note some properties can be set only during * marketplace gallery image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param marketplaceGalleryImageName Name of the marketplace gallery image. - * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @param 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() + 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 marketplace gallery image resource definition. + * @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. @@ -598,33 +487,26 @@ private Mono createOrUpdateAsync( * @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); + 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 marketplace gallery image resource definition. + * @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, + public MarketplaceGalleryImagesInner createOrUpdate(String resourceGroupName, String marketplaceGalleryImageName, MarketplaceGalleryImagesInner marketplaceGalleryImages) { return createOrUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages).block(); } @@ -632,10 +514,10 @@ public MarketplaceGalleryImagesInner createOrUpdate( /** * The operation to create or update a marketplace gallery image. Please note some properties can be set only during * marketplace gallery image creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param marketplaceGalleryImageName Name of the marketplace gallery image. - * @param marketplaceGalleryImages The marketplace gallery image resource definition. + * @param 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. @@ -643,18 +525,15 @@ public MarketplaceGalleryImagesInner createOrUpdate( * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MarketplaceGalleryImagesInner createOrUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesInner marketplaceGalleryImages, - Context context) { + 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. @@ -663,49 +542,34 @@ public MarketplaceGalleryImagesInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String marketplaceGalleryImageName) { + 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.")); + 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.")); + 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.")); + 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)) + .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. @@ -715,46 +579,33 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String marketplaceGalleryImageName, Context context) { + 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.")); + 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.")); + 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.")); + 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); + 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. @@ -763,18 +614,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String marketplaceGalleryImageName) { + 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()); + 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. @@ -784,19 +633,18 @@ private PollerFlux, Void> beginDeleteAsync( * @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) { + 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); + 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. @@ -805,14 +653,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String marketplaceGalleryImageName) { + 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. @@ -822,14 +670,14 @@ public SyncPoller, Void> beginDelete( * @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) { + 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. @@ -839,14 +687,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String marketplaceGalleryImageName) { - return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName) - .last() + 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. @@ -857,14 +704,13 @@ private Mono deleteAsync(String resourceGroupName, String marketplaceGalle */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String marketplaceGalleryImageName, Context context) { - return beginDeleteAsync(resourceGroupName, marketplaceGalleryImageName, context) - .last() + 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. @@ -878,7 +724,7 @@ public 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. @@ -893,135 +739,100 @@ public void delete(String resourceGroupName, String marketplaceGalleryImageName, /** * 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 marketplace gallery image resource patch definition. + * @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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { + 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.")); + 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.")); + 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.")); + 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.")); + 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)) + .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 marketplace gallery image resource patch definition. + * @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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, + 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.")); + 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.")); + 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.")); + 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.")); + 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); + 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 marketplace gallery image resource patch definition. + * @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. @@ -1029,27 +840,21 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( - String resourceGroupName, - String marketplaceGalleryImageName, + 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()); + 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 marketplace gallery image resource patch definition. + * @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. @@ -1058,29 +863,22 @@ private PollerFlux, MarketplaceGallery */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MarketplaceGalleryImagesInner> beginUpdateAsync( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, - Context context) { + 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); + 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 marketplace gallery image resource patch definition. + * @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. @@ -1088,20 +886,18 @@ private PollerFlux, MarketplaceGallery */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MarketplaceGalleryImagesInner> beginUpdate( - String resourceGroupName, - String marketplaceGalleryImageName, + String resourceGroupName, String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages) { - return this - .beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, 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 marketplace gallery image resource patch definition. + * @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. @@ -1110,42 +906,36 @@ public SyncPoller, MarketplaceGalleryI */ @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) + 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 marketplace gallery image resource patch definition. + * @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() + 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 marketplace gallery image resource patch definition. + * @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. @@ -1153,10 +943,8 @@ private Mono updateAsync( * @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, + private Mono updateAsync(String resourceGroupName, + String marketplaceGalleryImageName, MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, Context context) { return beginUpdateAsync(resourceGroupName, marketplaceGalleryImageName, marketplaceGalleryImages, context) .last() @@ -1165,29 +953,27 @@ private Mono updateAsync( /** * 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 marketplace gallery image resource patch definition. + * @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, + 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 marketplace gallery image resource patch definition. + * @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. @@ -1195,18 +981,15 @@ public MarketplaceGalleryImagesInner update( * @return the marketplace gallery image resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MarketplaceGalleryImagesInner update( - String resourceGroupName, - String marketplaceGalleryImageName, - MarketplaceGalleryImagesUpdateRequest marketplaceGalleryImages, - Context context) { + 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. @@ -1214,19 +997,15 @@ public MarketplaceGalleryImagesInner update( * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1234,32 +1013,17 @@ private Mono> listByResourceGroupSi } 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)) + .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. @@ -1268,19 +1032,15 @@ private Mono> listByResourceGroupSi * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1289,28 +1049,16 @@ private Mono> listByResourceGroupSi 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)); + .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. @@ -1319,14 +1067,14 @@ private Mono> listByResourceGroupSi */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1335,17 +1083,16 @@ private PagedFlux listByResourceGroupAsync(String * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + 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. @@ -1360,7 +1107,7 @@ public PagedIterable listByResourceGroup(String r /** * 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. @@ -1376,7 +1123,7 @@ public PagedIterable listByResourceGroup(String r /** * 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}. @@ -1384,44 +1131,26 @@ public PagedIterable listByResourceGroup(String r @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.")); + 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.")); + 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)) + .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. @@ -1431,41 +1160,26 @@ private Mono> listSinglePageAsync() @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1478,7 +1192,7 @@ private PagedFlux 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. @@ -1487,14 +1201,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1507,7 +1221,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1521,9 +1235,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1535,31 +1248,20 @@ private Mono> listNextSinglePageAsy 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1567,37 +1269,26 @@ private Mono> listNextSinglePageAsy * @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) { + 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1609,31 +1300,21 @@ private Mono> listAllNextSinglePage 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1641,29 +1322,19 @@ private Mono> listAllNextSinglePage * @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) { + 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.")); + 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)); + 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 index 895590ed0806..253aa77719c5 100644 --- 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 @@ -21,24 +21,18 @@ public final class MarketplaceGalleryImagesOperationsImpl implements Marketplace private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public MarketplaceGalleryImagesOperationsImpl( - MarketplaceGalleryImagesOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MarketplaceGalleryImagesImpl(inner.getValue(), this.manager())); } else { return null; @@ -46,8 +40,8 @@ public Response getByResourceGroupWithResponse( } public MarketplaceGalleryImages getByResourceGroup(String resourceGroupName, String marketplaceGalleryImageName) { - MarketplaceGalleryImagesInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, marketplaceGalleryImageName); + MarketplaceGalleryImagesInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, marketplaceGalleryImageName); if (inner != null) { return new MarketplaceGalleryImagesImpl(inner, this.manager()); } else { @@ -64,113 +58,80 @@ public void delete(String resourceGroupName, String marketplaceGalleryImageName, } public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceGalleryImagesImpl(inner1, this.manager())); } public MarketplaceGalleryImages getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + 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))); + 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) + return this.getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, marketplaceGalleryImageName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", id))); } this.delete(resourceGroupName, marketplaceGalleryImageName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String marketplaceGalleryImageName = Utils.getValueFromIdByName(id, "marketplaceGalleryImages"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceGalleryImages'.", id))); } this.delete(resourceGroupName, marketplaceGalleryImageName, context); } 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 index 3d4a8fab6f37..861245ba9e7e 100644 --- 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 @@ -11,8 +11,8 @@ 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.NetworkInterfaceStatus; import com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest; import com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum; import java.util.Collections; @@ -115,20 +115,16 @@ public NetworkInterfacesImpl withExistingResourceGroup(String resourceGroupName) } public NetworkInterfaces create() { - this.innerObject = - serviceManager - .serviceClient() - .getNetworkInterfacesOperations() - .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getNetworkInterfacesOperations() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), context); return this; } @@ -144,49 +140,40 @@ public NetworkInterfacesImpl update() { } public NetworkInterfaces apply() { - this.innerObject = - serviceManager - .serviceClient() - .getNetworkInterfacesOperations() - .update(resourceGroupName, networkInterfaceName, updateNetworkInterfaces, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getNetworkInterfacesOperations() + .update(resourceGroupName, networkInterfaceName, updateNetworkInterfaces, context); return this; } - NetworkInterfacesImpl( - NetworkInterfacesInner innerObject, + NetworkInterfacesImpl(NetworkInterfacesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getNetworkInterfacesOperations() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, context) + .getValue(); return this; } 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 index cbe151fc0790..28a286ec4e39 100644 --- 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 @@ -40,24 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in NetworkInterfacesOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final NetworkInterfacesOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(NetworkInterfacesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -68,112 +72,87 @@ public final class NetworkInterfacesOperationsClientImpl implements NetworkInter @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}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({202, 204}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkInterfaces") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. @@ -182,19 +161,15 @@ Mono> listAllNext( * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -207,22 +182,14 @@ private Mono> getByResourceGroupWithResponseAsy final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - networkInterfaceName, - this.client.getApiVersion(), - accept, - context)) + 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. @@ -232,19 +199,15 @@ private Mono> getByResourceGroupWithResponseAsy * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -256,20 +219,13 @@ private Mono> getByResourceGroupWithResponseAsy } 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); + 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. @@ -278,15 +234,15 @@ private Mono> getByResourceGroupWithResponseAsy * @return a network interface on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String networkInterfaceName) { + 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. @@ -296,14 +252,14 @@ private Mono getByResourceGroupAsync( * @return a network interface along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String networkInterfaceName, Context context) { + 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. @@ -319,30 +275,26 @@ public NetworkInterfacesInner getByResourceGroup(String resourceGroupName, Strin /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -360,52 +312,36 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkInterfaceName, this.client.getApiVersion(), networkInterfaces, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -423,25 +359,17 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkInterfaceName, this.client.getApiVersion(), networkInterfaces, accept, context); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @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. @@ -450,25 +378,20 @@ private Mono>> createOrUpdateWithResponseAsync( @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()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkInterfacesInner.class, NetworkInterfacesInner.class, + this.client.getContext()); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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. @@ -477,30 +400,22 @@ private PollerFlux, NetworkInterfacesInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NetworkInterfacesInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesInner networkInterfaces, + 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); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkInterfacesInner.class, NetworkInterfacesInner.class, context); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @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. @@ -509,18 +424,17 @@ private PollerFlux, NetworkInterfacesInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces) + return this.beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces) .getSyncPoller(); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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. @@ -529,42 +443,38 @@ public SyncPoller, NetworkInterfacesInner> be */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NetworkInterfacesInner> beginCreateOrUpdate( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesInner networkInterfaces, + String resourceGroupName, String networkInterfaceName, NetworkInterfacesInner networkInterfaces, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) + return this.beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) .getSyncPoller(); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesInner networkInterfaces) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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. @@ -572,41 +482,37 @@ private Mono createOrUpdateAsync( * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesInner networkInterfaces, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @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) { + public NetworkInterfacesInner createOrUpdate(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesInner networkInterfaces) { return createOrUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).block(); } /** * The operation to create or update a network interface. Please note some properties can be set only during network * interface creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource definition. + * @param 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. @@ -614,17 +520,14 @@ public NetworkInterfacesInner createOrUpdate( * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfacesInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesInner networkInterfaces, - Context context) { + 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. @@ -633,19 +536,15 @@ public NetworkInterfacesInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -657,23 +556,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - networkInterfaceName, - this.client.getApiVersion(), - accept, - context)) + .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. @@ -683,19 +573,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName, Context context) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -707,20 +593,13 @@ private Mono>> deleteWithResponseAsync( } 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); + 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. @@ -731,15 +610,13 @@ private Mono>> deleteWithResponseAsync( @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()); + 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. @@ -749,19 +626,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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) { + 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); + 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. @@ -776,7 +652,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -786,14 +662,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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) { + 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. @@ -803,14 +679,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String networkInterfaceName) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName) - .last() + 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. @@ -821,14 +696,13 @@ private Mono deleteAsync(String resourceGroupName, String networkInterface */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String networkInterfaceName, Context context) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, context) - .last() + 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. @@ -842,7 +716,7 @@ public 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. @@ -857,30 +731,26 @@ public void delete(String resourceGroupName, String networkInterfaceName, Contex /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -899,50 +769,34 @@ private Mono>> updateWithResponseAsync( 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)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkInterfaceName, this.client.getApiVersion(), networkInterfaces, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -960,24 +814,16 @@ private Mono>> updateWithResponseAsync( } 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); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkInterfaceName, this.client.getApiVersion(), networkInterfaces, accept, context); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @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. @@ -986,24 +832,19 @@ private Mono>> updateWithResponseAsync( @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()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkInterfacesInner.class, NetworkInterfacesInner.class, + this.client.getContext()); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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. @@ -1012,46 +853,38 @@ private PollerFlux, NetworkInterfacesInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NetworkInterfacesInner> beginUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesUpdateRequest networkInterfaces, + 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); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkInterfacesInner.class, NetworkInterfacesInner.class, context); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @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) { + public SyncPoller, NetworkInterfacesInner> beginUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces) { return this.beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).getSyncPoller(); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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. @@ -1059,41 +892,36 @@ public SyncPoller, NetworkInterfacesInner> be * @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) + public SyncPoller, NetworkInterfacesInner> beginUpdate(String resourceGroupName, + String networkInterfaceName, NetworkInterfacesUpdateRequest networkInterfaces, Context context) { + return this.beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context) .getSyncPoller(); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @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() + private Mono updateAsync(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces) { + return beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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. @@ -1101,39 +929,35 @@ private Mono updateAsync( * @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() + private Mono updateAsync(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces, Context context) { + return beginUpdateAsync(resourceGroupName, networkInterfaceName, networkInterfaces, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @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) { + public NetworkInterfacesInner update(String resourceGroupName, String networkInterfaceName, + NetworkInterfacesUpdateRequest networkInterfaces) { return updateAsync(resourceGroupName, networkInterfaceName, networkInterfaces).block(); } /** * The operation to update a network interface. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkInterfaceName Name of the network interface. - * @param networkInterfaces The network interface resource patch definition. + * @param 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. @@ -1141,18 +965,15 @@ public NetworkInterfacesInner update( * @return the network interface resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfacesInner update( - String resourceGroupName, - String networkInterfaceName, - NetworkInterfacesUpdateRequest networkInterfaces, - Context context) { + 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. @@ -1162,16 +983,12 @@ public NetworkInterfacesInner update( @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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1179,32 +996,17 @@ private Mono> listByResourceGroupSinglePag } 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)) + .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. @@ -1213,19 +1015,15 @@ private Mono> listByResourceGroupSinglePag * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1234,28 +1032,16 @@ private Mono> listByResourceGroupSinglePag 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)); + .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. @@ -1264,14 +1050,14 @@ private Mono> listByResourceGroupSinglePag */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1281,15 +1067,14 @@ private PagedFlux listByResourceGroupAsync(String resour */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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. @@ -1304,7 +1089,7 @@ public PagedIterable listByResourceGroup(String resource /** * 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. @@ -1320,7 +1105,7 @@ public PagedIterable listByResourceGroup(String resource /** * 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}. @@ -1328,44 +1113,26 @@ public PagedIterable listByResourceGroup(String resource @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.")); + 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.")); + 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)) + .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. @@ -1375,41 +1142,26 @@ private Mono> listSinglePageAsync() { @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1422,7 +1174,7 @@ private PagedFlux 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. @@ -1431,14 +1183,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1451,7 +1203,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1465,9 +1217,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1479,31 +1230,20 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1516,31 +1256,20 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1552,31 +1281,21 @@ private Mono> listAllNextSinglePageAsync(S 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1589,23 +1308,13 @@ private Mono> listAllNextSinglePageAsync(S 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.")); + 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)); + 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 index b84e1939d523..2176c18cf58d 100644 --- 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 @@ -21,22 +21,18 @@ public final class NetworkInterfacesOperationsImpl implements NetworkInterfacesO private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public NetworkInterfacesOperationsImpl( - NetworkInterfacesOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NetworkInterfacesImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,105 +58,77 @@ public void delete(String resourceGroupName, String networkInterfaceName, Contex public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfacesImpl(inner1, this.manager())); } public NetworkInterfaces getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); } this.delete(resourceGroupName, networkInterfaceName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); } this.delete(resourceGroupName, networkInterfaceName, context); } 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 new file mode 100644 index 000000000000..2b1ebff07b91 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class OfferImpl implements Offer { + private OfferInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + OfferImpl(OfferInner 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 provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OfferInner 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/OffersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java new file mode 100644 index 000000000000..c8b098a95b57 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java @@ -0,0 +1,732 @@ +// Copyright (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.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.OfferList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OffersClient. + */ +public final class OffersClientImpl implements OffersClient { + /** + * The proxy service used to perform REST calls. + */ + private final OffersService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of OffersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OffersClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(OffersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientOffers to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientO") + public interface OffersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/offers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext(@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> listByClusterNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync(String resourceGroupName, String clusterName, + String publisherName, String expand) { + 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByPublisher(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, publisherName, this.client.getApiVersion(), expand, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync(String resourceGroupName, String clusterName, + String publisherName, String expand, 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + publisherName, this.client.getApiVersion(), expand, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync(String resourceGroupName, String clusterName, + String publisherName, String expand) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync(String resourceGroupName, String clusterName, + String publisherName) { + final String expand = null; + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync(String resourceGroupName, String clusterName, + String publisherName, String expand, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, + String publisherName) { + final String expand = null; + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName, + String expand, Context context) { + return new PagedIterable<>( + listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, String clusterName, + String expand) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), expand, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, String clusterName, + String expand, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), expand, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, String expand) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, String expand, + Context context) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, + Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand, context)); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String expand) { + 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, publisherName, offerName, this.client.getApiVersion(), expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String expand, 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + publisherName, offerName, this.client.getApiVersion(), expand, accept, context); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String publisherName, + String offerName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context).block(); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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 Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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/OffersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java new file mode 100644 index 000000000000..7fb259cdce4c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java @@ -0,0 +1,83 @@ +// Copyright (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.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.Offers; + +public final class OffersImpl implements Offers { + private static final ClientLogger LOGGER = new ClientLogger(OffersImpl.class); + + private final OffersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public OffersImpl(OffersClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName) { + PagedIterable inner + = this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName, + String expand, Context context) { + PagedIterable inner + = this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, + Context context) { + PagedIterable inner + = this.serviceClient().listByCluster(resourceGroupName, clusterName, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OfferImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + OfferInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName); + if (inner != null) { + return new OfferImpl(inner, this.manager()); + } else { + return null; + } + } + + private OffersClient 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/OperationImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationImpl.java deleted file mode 100644 index d118208f0f8c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationImpl.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.implementation; - -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; -import com.azure.resourcemanager.azurestackhci.models.ActionType; -import com.azure.resourcemanager.azurestackhci.models.Operation; -import com.azure.resourcemanager.azurestackhci.models.OperationDisplay; -import com.azure.resourcemanager.azurestackhci.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner 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/OperationListResultImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java new file mode 100644 index 000000000000..27426092a831 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; +import java.util.Collections; +import java.util.List; + +public final class OperationListResultImpl implements OperationListResult { + private OperationListResultInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + OperationListResultImpl(OperationListResultInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public OperationListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java index 388474afc128..b46ba730b853 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java @@ -10,42 +10,42 @@ 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.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; -import com.azure.resourcemanager.azurestackhci.models.OperationListResult; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AzureStackHciClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(AzureStackHciClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,221 +56,92 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientO") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AzureStackHCI/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listWithResponseAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the supported operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the supported operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider 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 - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @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())); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List all available Microsoft.AzureStackHCI provider operations. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @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)); + public OperationListResultInner list() { + return listWithResponse(Context.NONE).getValue(); } } 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 e3113f3f3b1c..55554d78e9b3 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 @@ -4,12 +4,13 @@ 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.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; -import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; import com.azure.resourcemanager.azurestackhci.models.Operations; public final class OperationsImpl implements Operations { @@ -19,20 +20,29 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } } private OperationsClient serviceClient() { 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 new file mode 100644 index 000000000000..f58a4556f483 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.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.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; +import java.time.OffsetDateTime; + +public final class PasswordCredentialImpl implements PasswordCredential { + private PasswordCredentialInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PasswordCredentialImpl(PasswordCredentialInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String secretText() { + return this.innerModel().secretText(); + } + + public String keyId() { + return this.innerModel().keyId(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public PasswordCredentialInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java new file mode 100644 index 000000000000..412046443c03 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; + +public final class PublisherImpl implements Publisher { + private PublisherInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PublisherImpl(PublisherInner 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 provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublisherInner 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/PublishersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java new file mode 100644 index 000000000000..d0f93a6b4129 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.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.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.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.PublisherList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PublishersClient. + */ +public final class PublishersClientImpl implements PublishersClient { + /** + * The proxy service used to perform REST calls. + */ + private final PublishersService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of PublishersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublishersClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(PublishersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientPublishers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientP") + public interface PublishersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName) { + 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, publisherName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName, 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + publisherName, this.client.getApiVersion(), accept, context); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, context).block(); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner get(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponse(resourceGroupName, clusterName, publisherName, Context.NONE).getValue(); + } + + /** + * 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 Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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 Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(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/PublishersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java new file mode 100644 index 000000000000..633fca2b6424 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; +import com.azure.resourcemanager.azurestackhci.models.Publishers; + +public final class PublishersImpl implements Publishers { + private static final ClientLogger LOGGER = new ClientLogger(PublishersImpl.class); + + private final PublishersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public PublishersImpl(PublishersClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner + = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, publisherName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PublisherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Publisher get(String resourceGroupName, String clusterName, String publisherName) { + PublisherInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName); + if (inner != null) { + return new PublisherImpl(inner, this.manager()); + } else { + return null; + } + } + + private PublishersClient 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/Utils.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ResourceManagerUtils.java similarity index 90% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/Utils.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ResourceManagerUtils.java index 60dd8ee20f6f..f691c2e09a2e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/Utils.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ResourceManagerUtils.java @@ -19,8 +19,8 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { - private Utils() { +final class ResourceManagerUtils { + private ResourceManagerUtils() { } static String getValueFromIdByName(String id, String name) { @@ -87,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override 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 new file mode 100644 index 000000000000..068a79ff7f06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; +import com.azure.resourcemanager.azurestackhci.models.ComplianceAssignmentType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SecurityComplianceStatus; +import com.azure.resourcemanager.azurestackhci.models.SecuritySetting; + +public final class SecuritySettingImpl implements SecuritySetting, SecuritySetting.Definition, SecuritySetting.Update { + private SecuritySettingInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ComplianceAssignmentType securedCoreComplianceAssignment() { + return this.innerModel().securedCoreComplianceAssignment(); + } + + public SecurityComplianceStatus securityComplianceStatus() { + return this.innerModel().securityComplianceStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecuritySettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String securitySettingsName; + + public SecuritySettingImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public SecuritySetting create() { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .createOrUpdate(resourceGroupName, clusterName, securitySettingsName, this.innerModel(), Context.NONE); + return this; + } + + public SecuritySetting create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .createOrUpdate(resourceGroupName, clusterName, securitySettingsName, this.innerModel(), context); + return this; + } + + SecuritySettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new SecuritySettingInner(); + this.serviceManager = serviceManager; + this.securitySettingsName = name; + } + + public SecuritySettingImpl update() { + return this; + } + + public SecuritySetting apply() { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .createOrUpdate(resourceGroupName, clusterName, securitySettingsName, this.innerModel(), Context.NONE); + return this; + } + + public SecuritySetting apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .createOrUpdate(resourceGroupName, clusterName, securitySettingsName, this.innerModel(), context); + return this; + } + + SecuritySettingImpl(SecuritySettingInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.securitySettingsName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securitySettings"); + } + + public SecuritySetting refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .getWithResponse(resourceGroupName, clusterName, securitySettingsName, Context.NONE) + .getValue(); + return this; + } + + public SecuritySetting refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecuritySettings() + .getWithResponse(resourceGroupName, clusterName, securitySettingsName, context) + .getValue(); + return this; + } + + public SecuritySettingImpl + withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment) { + this.innerModel().withSecuredCoreComplianceAssignment(securedCoreComplianceAssignment); + 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/SecuritySettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsClientImpl.java new file mode 100644 index 000000000000..bc55205b9681 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsClientImpl.java @@ -0,0 +1,930 @@ +// Copyright (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.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.SecuritySettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; +import com.azure.resourcemanager.azurestackhci.models.SecuritySettingListResult; +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 SecuritySettingsClient. + */ +public final class SecuritySettingsClientImpl implements SecuritySettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecuritySettingsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of SecuritySettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecuritySettingsClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(SecuritySettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientSecuritySettings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + public interface SecuritySettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusters(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("securitySettingsName") String securitySettingsName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("securitySettingsName") String securitySettingsName, + @BodyParam("application/json") SecuritySettingInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("securitySettingsName") String securitySettingsName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClustersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersSinglePageAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByClusters(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersSinglePageAsync(String resourceGroupName, + String clusterName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusters(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClustersAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClustersSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClustersNextSinglePageAsync(nextLink)); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClustersAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listByClustersSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClustersNextSinglePageAsync(nextLink, context)); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusters(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClustersAsync(resourceGroupName, clusterName)); + } + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusters(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(listByClustersAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SecuritySetting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String securitySettingsName) { + 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, securitySettingsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SecuritySetting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String securitySettingsName, 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, securitySettingsName, accept, context); + } + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SecuritySetting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, + String securitySettingsName) { + return getWithResponseAsync(resourceGroupName, clusterName, securitySettingsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SecuritySetting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String securitySettingsName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, securitySettingsName, context).block(); + } + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SecuritySetting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecuritySettingInner get(String resourceGroupName, String clusterName, String securitySettingsName) { + return getWithResponse(resourceGroupName, clusterName, securitySettingsName, Context.NONE).getValue(); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String securitySettingsName, SecuritySettingInner resource) { + 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, securitySettingsName, resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String securitySettingsName, SecuritySettingInner resource, 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, securitySettingsName, resource, accept, + context); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecuritySettingInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String securitySettingsName, SecuritySettingInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, securitySettingsName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecuritySettingInner.class, SecuritySettingInner.class, this.client.getContext()); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecuritySettingInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String securitySettingsName, SecuritySettingInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, securitySettingsName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecuritySettingInner.class, SecuritySettingInner.class, context); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecuritySettingInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String securitySettingsName, SecuritySettingInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource) + .getSyncPoller(); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecuritySettingInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String securitySettingsName, SecuritySettingInner resource, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource, context) + .getSyncPoller(); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String securitySettingsName, SecuritySettingInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String securitySettingsName, SecuritySettingInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecuritySettingInner createOrUpdate(String resourceGroupName, String clusterName, + String securitySettingsName, SecuritySettingInner resource) { + return createOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource).block(); + } + + /** + * Create a security setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security settings proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecuritySettingInner createOrUpdate(String resourceGroupName, String clusterName, + String securitySettingsName, SecuritySettingInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, securitySettingsName, resource, context).block(); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String securitySettingsName) { + 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, securitySettingsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String securitySettingsName, 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 (securitySettingsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, securitySettingsName, accept, context); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String securitySettingsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, securitySettingsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String securitySettingsName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, securitySettingsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String securitySettingsName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, securitySettingsName).getSyncPoller(); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String securitySettingsName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, securitySettingsName, context).getSyncPoller(); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String securitySettingsName) { + return beginDeleteAsync(resourceGroupName, clusterName, securitySettingsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String securitySettingsName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, securitySettingsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String securitySettingsName) { + deleteAsync(resourceGroupName, clusterName, securitySettingsName).block(); + } + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String securitySettingsName, Context context) { + deleteAsync(resourceGroupName, clusterName, securitySettingsName, context).block(); + } + + /** + * 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 of a SecuritySetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersNextSinglePageAsync(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.listByClustersNext(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 of a SecuritySetting list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClustersNextSinglePageAsync(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.listByClustersNext(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/SecuritySettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.java new file mode 100644 index 000000000000..82420589dfab --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SecuritySettingsImpl.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.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.SecuritySettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; +import com.azure.resourcemanager.azurestackhci.models.SecuritySetting; +import com.azure.resourcemanager.azurestackhci.models.SecuritySettings; + +public final class SecuritySettingsImpl implements SecuritySettings { + private static final ClientLogger LOGGER = new ClientLogger(SecuritySettingsImpl.class); + + private final SecuritySettingsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public SecuritySettingsImpl(SecuritySettingsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByClusters(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByClusters(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySettingImpl(inner1, this.manager())); + } + + public PagedIterable listByClusters(String resourceGroupName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().listByClusters(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySettingImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, + String securitySettingsName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, securitySettingsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecuritySettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecuritySetting get(String resourceGroupName, String clusterName, String securitySettingsName) { + SecuritySettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, securitySettingsName); + if (inner != null) { + return new SecuritySettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String securitySettingsName) { + this.serviceClient().delete(resourceGroupName, clusterName, securitySettingsName); + } + + public void delete(String resourceGroupName, String clusterName, String securitySettingsName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, securitySettingsName, context); + } + + public SecuritySetting 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String securitySettingsName = ResourceManagerUtils.getValueFromIdByName(id, "securitySettings"); + if (securitySettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securitySettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, securitySettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String securitySettingsName = ResourceManagerUtils.getValueFromIdByName(id, "securitySettings"); + if (securitySettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securitySettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, securitySettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String securitySettingsName = ResourceManagerUtils.getValueFromIdByName(id, "securitySettings"); + if (securitySettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securitySettings'.", id))); + } + this.delete(resourceGroupName, clusterName, securitySettingsName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String securitySettingsName = ResourceManagerUtils.getValueFromIdByName(id, "securitySettings"); + if (securitySettingsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securitySettings'.", id))); + } + this.delete(resourceGroupName, clusterName, securitySettingsName, context); + } + + private SecuritySettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public SecuritySettingImpl define(String name) { + return new SecuritySettingImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..8a2673751d6f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class SkuImpl implements Sku { + private SkuInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + SkuImpl(SkuInner 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 provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String offerId() { + return this.innerModel().offerId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuInner 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/SkusClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..ce65bcfa3a6c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java @@ -0,0 +1,518 @@ +// Copyright (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.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.SkuList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public final class SkusClientImpl implements SkusClient { + /** + * The proxy service used to perform REST calls. + */ + private final SkusService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientSkus to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + public interface SkusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOffer(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, @PathParam("offerName") String offerName, + @PathParam("skuName") String skuName, @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOfferNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String expand) { + 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByOffer(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, publisherName, offerName, this.client.getApiVersion(), expand, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String expand, 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOffer(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + publisherName, offerName, this.client.getApiVersion(), expand, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync(String resourceGroupName, String clusterName, String publisherName, + String offerName) { + final String expand = null; + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context), + nextLink -> listByOfferNextSinglePageAsync(nextLink, context)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName) { + final String expand = null; + return new PagedIterable<>(listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context) { + return new PagedIterable<>( + listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context)); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String skuName, String expand) { + 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, publisherName, offerName, skuName, this.client.getApiVersion(), expand, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String publisherName, String offerName, String skuName, String expand, 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 (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + publisherName, offerName, skuName, this.client.getApiVersion(), expand, accept, context); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String publisherName, + String offerName, String skuName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String skuName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context) + .block(); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuInner get(String resourceGroupName, String clusterName, String publisherName, String offerName, + String skuName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(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.listByOfferNext(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 SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(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.listByOfferNext(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/SkusImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java new file mode 100644 index 000000000000..e5c630dd246a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public SkusImpl(SkusClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName) { + PagedIterable inner + = this.serviceClient().listByOffer(resourceGroupName, clusterName, publisherName, offerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context) { + PagedIterable inner = this.serviceClient() + .listByOffer(resourceGroupName, clusterName, publisherName, offerName, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String skuName, String expand, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Sku get(String resourceGroupName, String clusterName, String publisherName, String offerName, + String skuName) { + SkuInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName, skuName); + if (inner != null) { + return new SkuImpl(inner, this.manager()); + } else { + return null; + } + } + + private SkusClient 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/StorageContainersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StorageContainersImpl.java index abd5a3f5b3ac..3280dfabb7fc 100644 --- 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 @@ -10,8 +10,8 @@ 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.StorageContainerStatus; import com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest; import java.util.Collections; import java.util.Map; @@ -99,20 +99,16 @@ public StorageContainersImpl withExistingResourceGroup(String resourceGroupName) } public StorageContainers create() { - this.innerObject = - serviceManager - .serviceClient() - .getStorageContainersOperations() - .createOrUpdate(resourceGroupName, storageContainerName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getStorageContainersOperations() + .createOrUpdate(resourceGroupName, storageContainerName, this.innerModel(), context); return this; } @@ -128,49 +124,40 @@ public StorageContainersImpl update() { } public StorageContainers apply() { - this.innerObject = - serviceManager - .serviceClient() - .getStorageContainersOperations() - .update(resourceGroupName, storageContainerName, updateStorageContainers, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getStorageContainersOperations() + .update(resourceGroupName, storageContainerName, updateStorageContainers, context); return this; } - StorageContainersImpl( - StorageContainersInner innerObject, + StorageContainersImpl(StorageContainersInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.storageContainerName = Utils.getValueFromIdByName(innerObject.id(), "storageContainers"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getStorageContainersOperations() + .getByResourceGroupWithResponse(resourceGroupName, storageContainerName, context) + .getValue(); return this; } 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 index 2ef81e434cd4..7e7fda20147d 100644 --- 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 @@ -40,24 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in StorageContainersOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final StorageContainersOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(StorageContainersOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -68,112 +72,87 @@ public final class StorageContainersOperationsClientImpl implements StorageConta @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}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}") - @ExpectedResponses({202, 204}) + @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, + 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); + @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}) + @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, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storageContainers") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. @@ -182,19 +161,15 @@ Mono> listAllNext( * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -207,22 +182,14 @@ private Mono> getByResourceGroupWithResponseAsy final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - storageContainerName, - this.client.getApiVersion(), - accept, - context)) + 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. @@ -232,19 +199,15 @@ private Mono> getByResourceGroupWithResponseAsy * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -256,20 +219,13 @@ private Mono> getByResourceGroupWithResponseAsy } 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); + 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. @@ -278,15 +234,15 @@ private Mono> getByResourceGroupWithResponseAsy * @return a storage container on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String storageContainerName) { + 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. @@ -296,14 +252,14 @@ private Mono getByResourceGroupAsync( * @return a storage container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String storageContainerName, Context context) { + 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. @@ -319,30 +275,26 @@ public StorageContainersInner getByResourceGroup(String resourceGroupName, Strin /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -360,52 +312,36 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, storageContainerName, this.client.getApiVersion(), storageContainers, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -423,25 +359,17 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + storageContainerName, this.client.getApiVersion(), storageContainers, accept, context); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @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. @@ -450,25 +378,20 @@ private Mono>> createOrUpdateWithResponseAsync( @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()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageContainersInner.class, StorageContainersInner.class, + this.client.getContext()); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -477,30 +400,22 @@ private PollerFlux, StorageContainersInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageContainersInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String storageContainerName, - StorageContainersInner storageContainers, + 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); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageContainersInner.class, StorageContainersInner.class, context); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @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. @@ -509,18 +424,17 @@ private PollerFlux, StorageContainersInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageContainersInner> beginCreateOrUpdate( String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers) + return this.beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers) .getSyncPoller(); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -529,42 +443,38 @@ public SyncPoller, StorageContainersInner> be */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageContainersInner> beginCreateOrUpdate( - String resourceGroupName, - String storageContainerName, - StorageContainersInner storageContainers, + String resourceGroupName, String storageContainerName, StorageContainersInner storageContainers, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) + return this.beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) .getSyncPoller(); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String storageContainerName, + StorageContainersInner storageContainers) { + return beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -572,41 +482,37 @@ private Mono createOrUpdateAsync( * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String storageContainerName, + StorageContainersInner storageContainers, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @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) { + public StorageContainersInner createOrUpdate(String resourceGroupName, String storageContainerName, + StorageContainersInner storageContainers) { return createOrUpdateAsync(resourceGroupName, storageContainerName, storageContainers).block(); } /** * The operation to create or update a storage container. Please note some properties can be set only during storage * container creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource definition. + * @param 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. @@ -614,17 +520,14 @@ public StorageContainersInner createOrUpdate( * @return the storage container resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageContainersInner createOrUpdate( - String resourceGroupName, - String storageContainerName, - StorageContainersInner storageContainers, - Context context) { + 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. @@ -633,19 +536,15 @@ public StorageContainersInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String storageContainerName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -657,23 +556,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - storageContainerName, - this.client.getApiVersion(), - accept, - context)) + .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. @@ -683,19 +573,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String storageContainerName, Context context) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -707,20 +593,13 @@ private Mono>> deleteWithResponseAsync( } 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); + 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. @@ -731,15 +610,13 @@ private Mono>> deleteWithResponseAsync( @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()); + 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. @@ -749,19 +626,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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) { + 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); + 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. @@ -776,7 +652,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -786,14 +662,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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) { + 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. @@ -803,14 +679,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String storageContainerName) { - return beginDeleteAsync(resourceGroupName, storageContainerName) - .last() + 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. @@ -821,14 +696,13 @@ private Mono deleteAsync(String resourceGroupName, String storageContainer */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String storageContainerName, Context context) { - return beginDeleteAsync(resourceGroupName, storageContainerName, context) - .last() + 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. @@ -842,7 +716,7 @@ public 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. @@ -857,30 +731,26 @@ public void delete(String resourceGroupName, String storageContainerName, Contex /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -899,50 +769,34 @@ private Mono>> updateWithResponseAsync( 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)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + storageContainerName, this.client.getApiVersion(), storageContainers, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -960,24 +814,16 @@ private Mono>> updateWithResponseAsync( } 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); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + storageContainerName, this.client.getApiVersion(), storageContainers, accept, context); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @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. @@ -986,24 +832,19 @@ private Mono>> updateWithResponseAsync( @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()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageContainersInner.class, StorageContainersInner.class, + this.client.getContext()); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -1012,46 +853,38 @@ private PollerFlux, StorageContainersInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageContainersInner> beginUpdateAsync( - String resourceGroupName, - String storageContainerName, - StorageContainersUpdateRequest storageContainers, + 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); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, storageContainerName, storageContainers, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageContainersInner.class, StorageContainersInner.class, context); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @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) { + public SyncPoller, StorageContainersInner> beginUpdate(String resourceGroupName, + String storageContainerName, StorageContainersUpdateRequest storageContainers) { return this.beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers).getSyncPoller(); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -1059,41 +892,36 @@ public SyncPoller, StorageContainersInner> be * @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) + public SyncPoller, StorageContainersInner> beginUpdate(String resourceGroupName, + String storageContainerName, StorageContainersUpdateRequest storageContainers, Context context) { + return this.beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context) .getSyncPoller(); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @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() + private Mono updateAsync(String resourceGroupName, String storageContainerName, + StorageContainersUpdateRequest storageContainers) { + return beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -1101,39 +929,35 @@ private Mono updateAsync( * @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() + private Mono updateAsync(String resourceGroupName, String storageContainerName, + StorageContainersUpdateRequest storageContainers, Context context) { + return beginUpdateAsync(resourceGroupName, storageContainerName, storageContainers, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @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) { + public StorageContainersInner update(String resourceGroupName, String storageContainerName, + StorageContainersUpdateRequest storageContainers) { return updateAsync(resourceGroupName, storageContainerName, storageContainers).block(); } /** * The operation to update a storage container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageContainerName Name of the storage container. - * @param storageContainers The storage container resource patch definition. + * @param 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. @@ -1141,18 +965,15 @@ public StorageContainersInner update( * @return the storage container resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageContainersInner update( - String resourceGroupName, - String storageContainerName, - StorageContainersUpdateRequest storageContainers, - Context context) { + 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. @@ -1162,16 +983,12 @@ public StorageContainersInner update( @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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1179,32 +996,17 @@ private Mono> listByResourceGroupSinglePag } 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)) + .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. @@ -1213,19 +1015,15 @@ private Mono> listByResourceGroupSinglePag * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1234,28 +1032,16 @@ private Mono> listByResourceGroupSinglePag 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)); + .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. @@ -1264,14 +1050,14 @@ private Mono> listByResourceGroupSinglePag */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1281,15 +1067,14 @@ private PagedFlux listByResourceGroupAsync(String resour */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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. @@ -1304,7 +1089,7 @@ public PagedIterable listByResourceGroup(String resource /** * 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. @@ -1320,7 +1105,7 @@ public PagedIterable listByResourceGroup(String resource /** * 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}. @@ -1328,44 +1113,26 @@ public PagedIterable listByResourceGroup(String resource @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.")); + 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.")); + 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)) + .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. @@ -1375,41 +1142,26 @@ private Mono> listSinglePageAsync() { @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1422,7 +1174,7 @@ private PagedFlux 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. @@ -1431,14 +1183,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1451,7 +1203,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1465,9 +1217,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1479,31 +1230,20 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1516,31 +1256,20 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1552,31 +1281,21 @@ private Mono> listAllNextSinglePageAsync(S 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1589,23 +1308,13 @@ private Mono> listAllNextSinglePageAsync(S 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.")); + 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)); + 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 index 307033ff6113..300df79793d5 100644 --- 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 @@ -21,22 +21,18 @@ public final class StorageContainersOperationsImpl implements StorageContainersO private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public StorageContainersOperationsImpl( - StorageContainersOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new StorageContainersImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,105 +58,77 @@ public void delete(String resourceGroupName, String storageContainerName, Contex public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageContainersImpl(inner1, this.manager())); } public StorageContainers getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, storageContainerName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, storageContainerName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); } this.delete(resourceGroupName, storageContainerName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageContainerName = Utils.getValueFromIdByName(id, "storageContainers"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageContainers'.", id))); } this.delete(resourceGroupName, storageContainerName, context); } 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 new file mode 100644 index 000000000000..94215f56b410 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateRunImpl implements UpdateRun, UpdateRun.Definition, UpdateRun.Update { + private UpdateRunInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime timeStarted() { + return this.innerModel().timeStarted(); + } + + public OffsetDateTime lastUpdatedTime() { + return this.innerModel().lastUpdatedTime(); + } + + public String duration() { + return this.innerModel().duration(); + } + + public UpdateRunPropertiesState state() { + return this.innerModel().state(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTimeUtc() { + return this.innerModel().startTimeUtc(); + } + + public OffsetDateTime endTimeUtc() { + return this.innerModel().endTimeUtc(); + } + + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerModel().lastUpdatedTimeUtc(); + } + + public List steps() { + List inner = this.innerModel().steps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public UpdateRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + private String updateRunName; + + public UpdateRunImpl withExistingUpdate(String resourceGroupName, String clusterName, String updateName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.updateName = updateName; + return this; + } + + public UpdateRun create() { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new UpdateRunInner(); + this.serviceManager = serviceManager; + this.updateRunName = name; + } + + public UpdateRunImpl update() { + return this; + } + + public UpdateRun apply() { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl(UpdateRunInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "updates"); + this.updateRunName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "updateRuns"); + } + + public UpdateRun refresh() { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE) + .getValue(); + return this; + } + + public UpdateRun refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context) + .getValue(); + return this; + } + + public UpdateRunImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public UpdateRunImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public UpdateRunImpl withTimeStarted(OffsetDateTime timeStarted) { + this.innerModel().withTimeStarted(timeStarted); + return this; + } + + public UpdateRunImpl withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.innerModel().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + public UpdateRunImpl withDuration(String duration) { + this.innerModel().withDuration(duration); + return this; + } + + public UpdateRunImpl withState(UpdateRunPropertiesState state) { + this.innerModel().withState(state); + return this; + } + + public UpdateRunImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public UpdateRunImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public UpdateRunImpl withErrorMessage(String errorMessage) { + this.innerModel().withErrorMessage(errorMessage); + return this; + } + + public UpdateRunImpl withStatus(String status) { + this.innerModel().withStatus(status); + return this; + } + + public UpdateRunImpl withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.innerModel().withStartTimeUtc(startTimeUtc); + return this; + } + + public UpdateRunImpl withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.innerModel().withEndTimeUtc(endTimeUtc); + return this; + } + + public UpdateRunImpl withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.innerModel().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + 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/UpdateRunsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java new file mode 100644 index 000000000000..26c85281e2b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java @@ -0,0 +1,874 @@ +// Copyright (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.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.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunList; +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 UpdateRunsClient. + */ +public final class UpdateRunsClientImpl implements UpdateRunsClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpdateRunsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateRunsClientImpl(AzureStackHciClientImpl client) { + this.service + = RestProxy.create(UpdateRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateRuns to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateRunsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateRunInner updateRunsProperties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @PathParam("updateRunName") String updateRunName, + @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); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, + String updateName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, updateName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, + String updateName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName 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(), resourceGroupName, clusterName, + updateName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, String updateName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, updateName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, String updateName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, updateName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String updateName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName, context)); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, updateName, updateRunName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName 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, + clusterName, updateName, updateRunName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String updateName, String updateRunName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName).getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String updateName, String updateRunName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context) + .getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName, + String updateRunName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName).block(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, + Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName, UpdateRunInner updateRunsProperties) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, updateName, updateRunName, this.client.getApiVersion(), + updateRunsProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName, UpdateRunInner updateRunsProperties, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + updateName, updateRunName, this.client.getApiVersion(), updateRunsProperties, accept, context); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String clusterName, String updateName, + String updateRunName, UpdateRunInner updateRunsProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, UpdateRunInner updateRunsProperties, Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, + context).block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner put(String resourceGroupName, String clusterName, String updateName, String updateRunName, + UpdateRunInner updateRunsProperties) { + return putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, + Context.NONE).getValue(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, updateName, updateRunName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, String updateRunName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + updateName, updateRunName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String updateName, + String updateRunName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE).getValue(); + } + + /** + * 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 Update runs 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 Update runs 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/UpdateRunsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java new file mode 100644 index 000000000000..b096203fef65 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; + +public final class UpdateRunsImpl implements UpdateRuns { + private static final ClientLogger LOGGER = new ClientLogger(UpdateRunsImpl.class); + + private final UpdateRunsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateRunsImpl(UpdateRunsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, updateName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, String updateName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, updateName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, + Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UpdateRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + UpdateRunInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName, updateRunName); + if (inner != null) { + return new UpdateRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateRun 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = ResourceManagerUtils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = ResourceManagerUtils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = ResourceManagerUtils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = ResourceManagerUtils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + private UpdateRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public UpdateRunImpl define(String name) { + return new UpdateRunImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..d411c7c5bd44 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java @@ -0,0 +1,111 @@ +// Copyright (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.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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateSummariesImpl implements UpdateSummaries { + private UpdateSummariesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + UpdateSummariesImpl(UpdateSummariesInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String oemFamily() { + return this.innerModel().oemFamily(); + } + + public String hardwareModel() { + return this.innerModel().hardwareModel(); + } + + public List packageVersions() { + List inner = this.innerModel().packageVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String currentVersion() { + return this.innerModel().currentVersion(); + } + + public OffsetDateTime lastUpdated() { + return this.innerModel().lastUpdated(); + } + + public OffsetDateTime lastChecked() { + return this.innerModel().lastChecked(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public UpdateSummariesPropertiesState state() { + return this.innerModel().state(); + } + + public UpdateSummariesInner 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/UpdateSummariesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java new file mode 100644 index 000000000000..63080a357a83 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java @@ -0,0 +1,764 @@ +// Copyright (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.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.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesList; +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 UpdateSummariesOperationsClient. + */ +public final class UpdateSummariesOperationsClientImpl implements UpdateSummariesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpdateSummariesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateSummariesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateSummariesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(UpdateSummariesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateSummariesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateSummariesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSummariesInner updateLocationProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @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); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties) { + 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 (updateLocationProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), updateLocationProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties, 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 (updateLocationProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), updateLocationProperties, accept, context); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties, Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner put(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties) { + return putWithResponse(resourceGroupName, clusterName, updateLocationProperties, Context.NONE).getValue(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), accept, context); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner get(String resourceGroupName, String clusterName) { + return getWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * 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 Update Summaries 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 Update Summaries 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/UpdateSummariesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java new file mode 100644 index 000000000000..5645597784d9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.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.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.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; + +public final class UpdateSummariesOperationsImpl implements UpdateSummariesOperations { + private static final ClientLogger LOGGER = new ClientLogger(UpdateSummariesOperationsImpl.class); + + private final UpdateSummariesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateSummariesOperationsImpl(UpdateSummariesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public Response putWithResponse(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties, Context context) { + Response inner + = this.serviceClient().putWithResponse(resourceGroupName, clusterName, updateLocationProperties, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries put(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties) { + UpdateSummariesInner inner = this.serviceClient().put(resourceGroupName, clusterName, updateLocationProperties); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String clusterName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries get(String resourceGroupName, String clusterName) { + UpdateSummariesInner inner = this.serviceClient().get(resourceGroupName, clusterName); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + private UpdateSummariesOperationsClient 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/UpdatesClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java new file mode 100644 index 000000000000..370e34d69438 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java @@ -0,0 +1,1037 @@ +// Copyright (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.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.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateList; +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 UpdatesClient. + */ +public final class UpdatesClientImpl implements UpdatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpdatesService service; + + /** + * The service client containing this operation class. + */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdates to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdatesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HciUpdateInner updateProperties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, @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); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync(String resourceGroupName, String clusterName, + String updateName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, updateName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> postWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.post(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + updateName, this.client.getApiVersion(), accept, context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPostAsync(String resourceGroupName, String clusterName, + String updateName) { + Mono>> mono = postWithResponseAsync(resourceGroupName, clusterName, updateName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPostAsync(String resourceGroupName, String clusterName, + String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = postWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPost(String resourceGroupName, String clusterName, + String updateName) { + return this.beginPostAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPost(String resourceGroupName, String clusterName, String updateName, + Context context) { + return this.beginPostAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String clusterName, String updateName) { + return beginPostAsync(resourceGroupName, clusterName, updateName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 postAsync(String resourceGroupName, String clusterName, String updateName, Context context) { + return beginPostAsync(resourceGroupName, clusterName, updateName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void post(String resourceGroupName, String clusterName, String updateName) { + postAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 post(String resourceGroupName, String clusterName, String updateName, Context context) { + postAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String updateName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, updateName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName 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, + clusterName, updateName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String updateName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, updateName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String updateName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String updateName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName) { + deleteAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName, Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, HciUpdateInner updateProperties) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, updateName, this.client.getApiVersion(), updateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, HciUpdateInner updateProperties, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + updateName, this.client.getApiVersion(), updateProperties, accept, context); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String clusterName, String updateName, + HciUpdateInner updateProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String clusterName, String updateName, + HciUpdateInner updateProperties, Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HciUpdateInner put(String resourceGroupName, String clusterName, String updateName, + HciUpdateInner updateProperties) { + return putWithResponse(resourceGroupName, clusterName, updateName, updateProperties, Context.NONE).getValue(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String updateName) { + 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, updateName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String updateName, 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 (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + updateName, this.client.getApiVersion(), accept, context); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String updateName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HciUpdateInner get(String resourceGroupName, String clusterName, String updateName) { + return getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE).getValue(); + } + + /** + * 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 Updates 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 Updates 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/UpdatesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java new file mode 100644 index 000000000000..1a84ed0d2274 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.Updates; + +public final class UpdatesImpl implements Updates { + private static final ClientLogger LOGGER = new ClientLogger(UpdatesImpl.class); + + private final UpdatesClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdatesImpl(UpdatesClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void post(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().post(resourceGroupName, clusterName, updateName); + } + + public void post(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().post(resourceGroupName, clusterName, updateName, context); + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HciUpdateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HciUpdateImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, context); + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HciUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HciUpdate get(String resourceGroupName, String clusterName, String updateName) { + HciUpdateInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName); + if (inner != null) { + return new HciUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public HciUpdate 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = ResourceManagerUtils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, context); + } + + private UpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public HciUpdateImpl define(String name) { + return new HciUpdateImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..f17ea09f0a9d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ValidateResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ValidateResponse; + +public final class ValidateResponseImpl implements ValidateResponse { + private ValidateResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ValidateResponseImpl(ValidateResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String status() { + return this.innerModel().status(); + } + + public ValidateResponseInner 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/VirtualHardDisksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualHardDisksImpl.java index 820dbfdfc0bb..07548543bedc 100644 --- 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 @@ -12,8 +12,8 @@ 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.VirtualHardDiskStatus; import com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest; import java.util.Collections; import java.util.Map; @@ -129,20 +129,16 @@ public VirtualHardDisksImpl withExistingResourceGroup(String resourceGroupName) } public VirtualHardDisks create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualHardDisksOperations() - .createOrUpdate(resourceGroupName, virtualHardDiskName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getVirtualHardDisksOperations() + .createOrUpdate(resourceGroupName, virtualHardDiskName, this.innerModel(), context); return this; } @@ -158,49 +154,40 @@ public VirtualHardDisksImpl update() { } public VirtualHardDisks apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualHardDisksOperations() - .update(resourceGroupName, virtualHardDiskName, updateVirtualHardDisks, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getVirtualHardDisksOperations() + .update(resourceGroupName, virtualHardDiskName, updateVirtualHardDisks, context); return this; } - VirtualHardDisksImpl( - VirtualHardDisksInner innerObject, + VirtualHardDisksImpl(VirtualHardDisksInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualHardDiskName = Utils.getValueFromIdByName(innerObject.id(), "virtualHardDisks"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getVirtualHardDisksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, context) + .getValue(); return this; } 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 index 7b88e03860be..c6cf8acc8123 100644 --- 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 @@ -40,24 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VirtualHardDisksOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualHardDisksOperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(VirtualHardDisksOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -68,112 +72,85 @@ public final class VirtualHardDisksOperationsClientImpl implements VirtualHardDi @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}) + @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, + 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); + @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}) + @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, + 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, + @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}) + @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, + 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); + @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}) + @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, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHardDiskName") String virtualHardDiskName, - @QueryParam("api-version") String apiVersion, + @PathParam("virtualHardDiskName") String virtualHardDiskName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") VirtualHardDisksUpdateRequest virtualHardDisks, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks") - @ExpectedResponses({200}) + @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, + 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); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualHardDisks") - @ExpectedResponses({200}) + @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); + 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. @@ -182,19 +159,15 @@ Mono> listAllNext( * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -207,22 +180,14 @@ private Mono> getByResourceGroupWithResponseAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHardDiskName, - this.client.getApiVersion(), - accept, - context)) + 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. @@ -232,19 +197,15 @@ private Mono> getByResourceGroupWithResponseAsyn * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -256,20 +217,13 @@ private Mono> getByResourceGroupWithResponseAsyn } 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); + 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. @@ -285,7 +239,7 @@ private Mono getByResourceGroupAsync(String resourceGroup /** * 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. @@ -295,14 +249,14 @@ private Mono getByResourceGroupAsync(String resourceGroup * @return a virtual hard disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualHardDiskName, Context context) { + 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. @@ -318,30 +272,26 @@ public VirtualHardDisksInner getByResourceGroup(String resourceGroupName, String /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -359,49 +309,35 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHardDiskName, this.client.getApiVersion(), virtualHardDisks, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -419,25 +355,17 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHardDiskName, this.client.getApiVersion(), virtualHardDisks, accept, context); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @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. @@ -446,25 +374,20 @@ private Mono>> createOrUpdateWithResponseAsync( @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()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, + this.client.getContext()); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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. @@ -475,21 +398,19 @@ private PollerFlux, VirtualHardDisksInner> beg 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); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, context); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @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. @@ -504,10 +425,10 @@ public SyncPoller, VirtualHardDisksInner> begi /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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. @@ -517,38 +438,36 @@ public SyncPoller, VirtualHardDisksInner> begi @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) + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context) .getSyncPoller(); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksInner virtualHardDisks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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. @@ -556,38 +475,37 @@ private Mono createOrUpdateAsync( * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksInner virtualHardDisks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @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) { + public VirtualHardDisksInner createOrUpdate(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksInner virtualHardDisks) { return createOrUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).block(); } /** * The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual * hard disk creation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource definition. + * @param 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. @@ -595,14 +513,14 @@ public VirtualHardDisksInner createOrUpdate( * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHardDisksInner createOrUpdate( - String resourceGroupName, String virtualHardDiskName, VirtualHardDisksInner virtualHardDisks, Context context) { + 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. @@ -611,19 +529,15 @@ public VirtualHardDisksInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualHardDiskName) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -635,23 +549,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHardDiskName, - this.client.getApiVersion(), - accept, - context)) + .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. @@ -661,19 +566,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualHardDiskName, Context context) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -685,20 +586,13 @@ private Mono>> deleteWithResponseAsync( } 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); + 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. @@ -709,15 +603,13 @@ private Mono>> deleteWithResponseAsync( @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()); + 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. @@ -727,19 +619,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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) { + 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); + 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. @@ -754,7 +645,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -764,14 +655,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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) { + 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. @@ -781,14 +672,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String virtualHardDiskName) { - return beginDeleteAsync(resourceGroupName, virtualHardDiskName) - .last() + 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. @@ -799,14 +689,13 @@ private Mono deleteAsync(String resourceGroupName, String virtualHardDiskN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String virtualHardDiskName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualHardDiskName, context) - .last() + 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. @@ -820,7 +709,7 @@ public 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. @@ -835,30 +724,26 @@ public void delete(String resourceGroupName, String virtualHardDiskName, Context /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -876,51 +761,34 @@ private Mono>> updateWithResponseAsync( } 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)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHardDiskName, this.client.getApiVersion(), virtualHardDisks, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -938,24 +806,16 @@ private Mono>> updateWithResponseAsync( } 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); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHardDiskName, this.client.getApiVersion(), virtualHardDisks, accept, context); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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. @@ -964,24 +824,19 @@ private Mono>> updateWithResponseAsync( @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()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, + this.client.getContext()); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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. @@ -990,42 +845,38 @@ private PollerFlux, VirtualHardDisksInner> beg */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualHardDisksInner> beginUpdateAsync( - String resourceGroupName, - String virtualHardDiskName, - VirtualHardDisksUpdateRequest virtualHardDisks, + 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); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHardDisksInner.class, VirtualHardDisksInner.class, context); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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) { + public SyncPoller, VirtualHardDisksInner> beginUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks) { return this.beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).getSyncPoller(); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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. @@ -1033,39 +884,35 @@ public SyncPoller, VirtualHardDisksInner> begi * @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) { + public SyncPoller, VirtualHardDisksInner> beginUpdate(String resourceGroupName, + String virtualHardDiskName, VirtualHardDisksUpdateRequest virtualHardDisks, Context context) { return this.beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).getSyncPoller(); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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() + private Mono updateAsync(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks) { + return beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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. @@ -1073,39 +920,35 @@ private Mono updateAsync( * @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() + private Mono updateAsync(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks, Context context) { + return beginUpdateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @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) { + public VirtualHardDisksInner update(String resourceGroupName, String virtualHardDiskName, + VirtualHardDisksUpdateRequest virtualHardDisks) { return updateAsync(resourceGroupName, virtualHardDiskName, virtualHardDisks).block(); } /** * The operation to update a virtual hard disk. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualHardDiskName Name of the virtual hard disk. - * @param virtualHardDisks The virtual hard disk resource patch definition. + * @param 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. @@ -1113,18 +956,15 @@ public VirtualHardDisksInner update( * @return the virtual hard disk resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHardDisksInner update( - String resourceGroupName, - String virtualHardDiskName, - VirtualHardDisksUpdateRequest virtualHardDisks, - Context context) { + 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. @@ -1134,16 +974,12 @@ public VirtualHardDisksInner update( @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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1151,32 +987,17 @@ private Mono> listByResourceGroupSinglePage } 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)) + .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. @@ -1185,19 +1006,15 @@ private Mono> listByResourceGroupSinglePage * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1206,28 +1023,16 @@ private Mono> listByResourceGroupSinglePage 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)); + .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. @@ -1236,14 +1041,14 @@ private Mono> listByResourceGroupSinglePage */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -1253,15 +1058,14 @@ private PagedFlux listByResourceGroupAsync(String resourc */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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. @@ -1276,7 +1080,7 @@ public PagedIterable listByResourceGroup(String resourceG /** * 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. @@ -1292,7 +1096,7 @@ public PagedIterable listByResourceGroup(String resourceG /** * 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}. @@ -1300,44 +1104,26 @@ public PagedIterable listByResourceGroup(String resourceG @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.")); + 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.")); + 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)) + .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. @@ -1347,41 +1133,26 @@ private Mono> listSinglePageAsync() { @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.")); + 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.")); + 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, + .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)); + .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}. @@ -1394,7 +1165,7 @@ private PagedFlux 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. @@ -1403,14 +1174,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, 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}. @@ -1423,7 +1194,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -1437,9 +1208,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1451,31 +1221,20 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1488,31 +1247,20 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1524,31 +1272,21 @@ private Mono> listAllNextSinglePageAsync(St 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.")); + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1561,23 +1299,13 @@ private Mono> listAllNextSinglePageAsync(St 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.")); + 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)); + 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 index a660010a41c3..72210e370155 100644 --- 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 @@ -21,22 +21,18 @@ public final class VirtualHardDisksOperationsImpl implements VirtualHardDisksOpe private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public VirtualHardDisksOperationsImpl( - VirtualHardDisksOperationsClient innerClient, + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new VirtualHardDisksImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,105 +58,77 @@ public void delete(String resourceGroupName, String virtualHardDiskName, Context public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHardDisksImpl(inner1, this.manager())); } public VirtualHardDisks getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, virtualHardDiskName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); } this.delete(resourceGroupName, virtualHardDiskName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualHardDiskName = Utils.getValueFromIdByName(id, "virtualHardDisks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHardDisks'.", id))); } this.delete(resourceGroupName, virtualHardDiskName, context); } 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 index 478e6de52b02..621d5bf01742 100644 --- 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 @@ -25,8 +25,7 @@ public final class VirtualMachineInstanceImpl implements VirtualMachineInstance private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - VirtualMachineInstanceImpl( - VirtualMachineInstanceInner innerObject, + VirtualMachineInstanceImpl(VirtualMachineInstanceInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index f902174cdbd1..c7dc546cae7f 100644 --- 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 @@ -41,23 +41,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VirtualMachineInstancesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualMachineInstancesService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(VirtualMachineInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -68,112 +73,88 @@ public final class VirtualMachineInstancesClientImpl implements VirtualMachineIn @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientV") public interface VirtualMachineInstancesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") - @ExpectedResponses({202, 204}) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default") - @ExpectedResponses({200, 202}) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start") - @ExpectedResponses({200, 202}) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, + Mono>> start(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/stop") - @ExpectedResponses({200, 202}) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, + Mono>> stop(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart") - @ExpectedResponses({200, 202}) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, + Mono>> restart(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @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. + * 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. @@ -182,27 +163,24 @@ Mono> listNext( @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.")); + 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)) + .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. + * 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. @@ -212,10 +190,8 @@ private Mono> getWithResponseAsync(String @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.")); + 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.")); @@ -227,9 +203,9 @@ private Mono> getWithResponseAsync(String /** * Gets a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -242,9 +218,9 @@ private Mono getAsync(String resourceUri) { /** * Gets a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -258,9 +234,9 @@ public Response getWithResponse(String resourceUri, /** * Gets a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -274,128 +250,103 @@ public VirtualMachineInstanceInner get(String resourceUri) { /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + 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.")); + 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.")); + 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), virtualMachineInstance, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + 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.")); + 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.")); + 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); + return service.createOrUpdate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), + virtualMachineInstance, accept, context); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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) { + 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()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + this.client.getContext()); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -406,43 +357,38 @@ private PollerFlux, VirtualMachineInstan 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); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceUri, virtualMachineInstance, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + context); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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) { + public SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { return this.beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance).getSyncPoller(); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -450,38 +396,37 @@ public SyncPoller, VirtualMachineInstanc * @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) { + public SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { return this.beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance, context).getSyncPoller(); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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() + private Mono createOrUpdateAsync(String resourceUri, + VirtualMachineInstanceInner virtualMachineInstance) { + return beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -489,38 +434,37 @@ private Mono createOrUpdateAsync( * @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() + private Mono createOrUpdateAsync(String resourceUri, + VirtualMachineInstanceInner virtualMachineInstance, Context context) { + return beginCreateOrUpdateAsync(resourceUri, virtualMachineInstance, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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) { + public VirtualMachineInstanceInner createOrUpdate(String resourceUri, + VirtualMachineInstanceInner virtualMachineInstance) { return createOrUpdateAsync(resourceUri, virtualMachineInstance).block(); } /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -528,16 +472,16 @@ public VirtualMachineInstanceInner createOrUpdate( * @return the virtual machine instance resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstanceInner createOrUpdate( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { + 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. + * 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. @@ -546,28 +490,24 @@ public VirtualMachineInstanceInner createOrUpdate( @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.")); + 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)) + .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. + * 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. @@ -577,10 +517,8 @@ private Mono>> deleteWithResponseAsync(String resource @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.")); + 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.")); @@ -592,9 +530,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * 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. + * 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. @@ -603,17 +541,15 @@ private Mono>> deleteWithResponseAsync(String resource @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()); + 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. + * 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. @@ -624,16 +560,15 @@ private PollerFlux, Void> beginDeleteAsync(String resourceUri) 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); + 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. + * 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. @@ -646,9 +581,9 @@ public 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. + * 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. @@ -662,9 +597,9 @@ public SyncPoller, Void> beginDelete(String resourceUri, Contex /** * 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. + * 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. @@ -677,9 +612,9 @@ private Mono deleteAsync(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. + * 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. @@ -693,9 +628,9 @@ private Mono deleteAsync(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. + * 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. @@ -707,9 +642,9 @@ public 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. + * 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. @@ -722,125 +657,100 @@ public void delete(String resourceUri, Context context) { /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + 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.")); + 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.")); + 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)) + .withContext(context -> service.update(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), + virtualMachineInstance, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + 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.")); + 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.")); + 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); + return service.update(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), + virtualMachineInstance, accept, context); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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) { + 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()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + this.client.getContext()); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -852,39 +762,34 @@ private PollerFlux, VirtualMachineInstan 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); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + context); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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) { + public SyncPoller, VirtualMachineInstanceInner> + beginUpdate(String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { return this.beginUpdateAsync(resourceUri, virtualMachineInstance).getSyncPoller(); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -892,36 +797,35 @@ public SyncPoller, VirtualMachineInstanc * @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) { + public SyncPoller, VirtualMachineInstanceInner> + beginUpdate(String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { return this.beginUpdateAsync(resourceUri, virtualMachineInstance, context).getSyncPoller(); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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() + private Mono updateAsync(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + return beginUpdateAsync(resourceUri, virtualMachineInstance).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -929,36 +833,35 @@ private Mono updateAsync( * @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() + private Mono updateAsync(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + return beginUpdateAsync(resourceUri, virtualMachineInstance, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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) { + public VirtualMachineInstanceInner update(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance) { return updateAsync(resourceUri, virtualMachineInstance).block(); } /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -966,60 +869,55 @@ public VirtualMachineInstanceInner update( * @return the virtual machine instance resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstanceInner update( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + 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. + * 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}. + * {@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.")); + 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)) + .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. + * 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}. + * {@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.")); + 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.")); @@ -1031,33 +929,28 @@ private Mono>> startWithResponseAsync(String resourceU /** * 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. + * 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) { + 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()); + 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. + * 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. @@ -1065,41 +958,36 @@ private PollerFlux, VirtualMachineInstan * @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) { + 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); + 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. + * 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) { + 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. + * 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. @@ -1107,16 +995,16 @@ public SyncPoller, VirtualMachineInstanc * @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) { + 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. + * 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. @@ -1129,9 +1017,9 @@ private Mono startAsync(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. + * 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. @@ -1145,9 +1033,9 @@ private Mono startAsync(String resourceUri, 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. + * 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. @@ -1160,9 +1048,9 @@ public 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. + * 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. @@ -1176,53 +1064,48 @@ public 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. + * 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}. + * {@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.")); + 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)) + .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. + * 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}. + * {@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.")); + 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.")); @@ -1234,33 +1117,28 @@ private Mono>> stopWithResponseAsync(String resourceUr /** * 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. + * 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) { + 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()); + 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. + * 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. @@ -1268,41 +1146,36 @@ private PollerFlux, VirtualMachineInstan * @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) { + 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); + 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. + * 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) { + 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. + * 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. @@ -1310,16 +1183,16 @@ public SyncPoller, VirtualMachineInstanc * @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) { + 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. + * 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. @@ -1332,9 +1205,9 @@ private Mono stopAsync(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. + * 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. @@ -1348,9 +1221,9 @@ private Mono stopAsync(String resourceUri, 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. + * 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. @@ -1363,9 +1236,9 @@ public 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. + * 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. @@ -1379,54 +1252,48 @@ public 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. + * 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}. + * {@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.")); + 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)) + .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. + * 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}. + * {@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.")); + 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.")); @@ -1438,33 +1305,28 @@ private Mono>> restartWithResponseAsync(String resourc /** * 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. + * 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) { + 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()); + 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. + * 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. @@ -1472,41 +1334,36 @@ private PollerFlux, VirtualMachineInstan * @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) { + 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); + 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. + * 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) { + 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. + * 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. @@ -1514,16 +1371,16 @@ public SyncPoller, VirtualMachineInstanc * @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) { + 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. + * 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. @@ -1536,9 +1393,9 @@ private Mono restartAsync(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. + * 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. @@ -1552,9 +1409,9 @@ private Mono restartAsync(String resourceUri, Conte /** * 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. + * 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. @@ -1567,9 +1424,9 @@ public 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. + * 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. @@ -1583,9 +1440,9 @@ public 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. + * 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. @@ -1594,36 +1451,26 @@ public VirtualMachineInstanceInner restart(String resourceUri, Context context) @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.")); + 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)) + .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. + * 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. @@ -1633,34 +1480,24 @@ private Mono> listSinglePageAsync(Str @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.")); + 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)); + 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. + * 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. @@ -1673,9 +1510,9 @@ private PagedFlux listAsync(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. + * 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. @@ -1684,15 +1521,15 @@ private PagedFlux listAsync(String resourceUri) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceUri, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, 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. + * 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. @@ -1705,9 +1542,9 @@ public 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. + * 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. @@ -1721,9 +1558,8 @@ public PagedIterable list(String resourceUri, Conte /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -1735,31 +1571,20 @@ private Mono> listNextSinglePageAsync 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -1772,23 +1597,13 @@ private Mono> listNextSinglePageAsync 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.")); + 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)); + 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 index ff59ab561cfa..1de985bf98c5 100644 --- 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 @@ -12,8 +12,8 @@ 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; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; public final class VirtualMachineInstancesImpl implements VirtualMachineInstances { private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstancesImpl.class); @@ -22,8 +22,7 @@ public final class VirtualMachineInstancesImpl implements VirtualMachineInstance private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - public VirtualMachineInstancesImpl( - VirtualMachineInstancesClient innerClient, + public VirtualMachineInstancesImpl(VirtualMachineInstancesClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -32,10 +31,7 @@ public VirtualMachineInstancesImpl( 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new VirtualMachineInstanceImpl(inner.getValue(), this.manager())); } else { return null; @@ -51,8 +47,8 @@ public VirtualMachineInstance get(String resourceUri) { } } - public VirtualMachineInstance createOrUpdate( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance) { + public VirtualMachineInstance createOrUpdate(String resourceUri, + VirtualMachineInstanceInner virtualMachineInstance) { VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri, virtualMachineInstance); if (inner != null) { return new VirtualMachineInstanceImpl(inner, this.manager()); @@ -61,10 +57,10 @@ public VirtualMachineInstance createOrUpdate( } } - public VirtualMachineInstance createOrUpdate( - String resourceUri, VirtualMachineInstanceInner virtualMachineInstance, Context context) { - VirtualMachineInstanceInner inner = - this.serviceClient().createOrUpdate(resourceUri, virtualMachineInstance, context); + 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 { @@ -80,8 +76,8 @@ public void delete(String resourceUri, Context context) { this.serviceClient().delete(resourceUri, context); } - public VirtualMachineInstance update( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance) { + public VirtualMachineInstance update(String resourceUri, + VirtualMachineInstanceUpdateRequest virtualMachineInstance) { VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, virtualMachineInstance); if (inner != null) { return new VirtualMachineInstanceImpl(inner, this.manager()); @@ -90,8 +86,8 @@ public VirtualMachineInstance update( } } - public VirtualMachineInstance update( - String resourceUri, VirtualMachineInstanceUpdateRequest virtualMachineInstance, Context context) { + 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()); @@ -156,12 +152,12 @@ public VirtualMachineInstance restart(String resourceUri, Context context) { public PagedIterable list(String resourceUri) { PagedIterable inner = this.serviceClient().list(resourceUri); - return Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); } private VirtualMachineInstancesClient serviceClient() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/package-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/package-info.java index 50dee0db23a3..8c4a6cee8630 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/package-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for AzureStackHciClient. Azure Stack HCI management service. */ +/** + * Package containing the implementations for AzureStackHciClient. + * Azure Stack HCI management service. + */ package com.azure.resourcemanager.azurestackhci.implementation; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java index aa1ce726b5b4..5215c99fb8ec 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.java new file mode 100644 index 000000000000..e6a5362e80bc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AdapterPropertyOverrides.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 java.io.IOException; + +/** + * The AdapterPropertyOverrides of a cluster. + */ +@Fluent +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. + */ + 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 AdapterPropertyOverrides class. + */ + public AdapterPropertyOverrides() { + } + + /** + * 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; + } + + /** + * Set the jumboPacket property: This parameter should only be modified based on your OEM guidance. Do not modify + * this parameter without OEM validation. + * + * @param jumboPacket the jumboPacket value to set. + * @return the AdapterPropertyOverrides object itself. + */ + public AdapterPropertyOverrides withJumboPacket(String jumboPacket) { + this.jumboPacket = jumboPacket; + return this; + } + + /** + * 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; + } + + /** + * Set the networkDirect property: This parameter should only be modified based on your OEM guidance. Do not modify + * this parameter without OEM validation. + * + * @param networkDirect the networkDirect value to set. + * @return the AdapterPropertyOverrides object itself. + */ + public AdapterPropertyOverrides withNetworkDirect(String networkDirect) { + this.networkDirect = networkDirect; + return this; + } + + /** + * 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; + } + + /** + * Set 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'. + * + * @param networkDirectTechnology the networkDirectTechnology value to set. + * @return the AdapterPropertyOverrides object itself. + */ + public AdapterPropertyOverrides withNetworkDirectTechnology(String networkDirectTechnology) { + this.networkDirectTechnology = networkDirectTechnology; + 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("jumboPacket", this.jumboPacket); + jsonWriter.writeStringField("networkDirect", this.networkDirect); + jsonWriter.writeStringField("networkDirectTechnology", this.networkDirectTechnology); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdapterPropertyOverrides from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 AdapterPropertyOverrides fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdapterPropertyOverrides deserializedAdapterPropertyOverrides = new AdapterPropertyOverrides(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jumboPacket".equals(fieldName)) { + deserializedAdapterPropertyOverrides.jumboPacket = reader.getString(); + } else if ("networkDirect".equals(fieldName)) { + deserializedAdapterPropertyOverrides.networkDirect = reader.getString(); + } else if ("networkDirectTechnology".equals(fieldName)) { + deserializedAdapterPropertyOverrides.networkDirectTechnology = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdapterPropertyOverrides; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java new file mode 100644 index 000000000000..efe6947ba297 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; + +/** + * An immutable client-side representation of ArcIdentityResponse. + */ +public interface ArcIdentityResponse { + /** + * Gets the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner object. + * + * @return the inner object. + */ + ArcIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java new file mode 100644 index 000000000000..e528c6cac869 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ArcSetting. + */ +public interface ArcSetting { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + String arcInstanceResourceGroup(); + + /** + * Gets the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + + /** + * Gets the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + ArcSettingAggregateState aggregateState(); + + /** + * Gets the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + List perNodeDetails(); + + /** + * Gets the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + Object connectivityProperties(); + + /** + * Gets the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + List defaultExtensions(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner object. + * + * @return the inner object. + */ + ArcSettingInner innerModel(); + + /** + * The entirety of the ArcSetting definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ArcSetting definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ArcSetting definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ArcSetting definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the ArcSetting definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithArcInstanceResourceGroup, DefinitionStages.WithArcApplicationClientId, + DefinitionStages.WithArcApplicationTenantId, DefinitionStages.WithArcServicePrincipalObjectId, + DefinitionStages.WithArcApplicationObjectId, DefinitionStages.WithConnectivityProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArcSetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArcSetting create(Context context); + } + + /** + * The stage of the ArcSetting definition allowing to specify arcInstanceResourceGroup. + */ + interface WithArcInstanceResourceGroup { + /** + * Specifies the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid + * Compute Machine resources.. + * + * @param arcInstanceResourceGroup The resource group that hosts the Arc agents, ie. Hybrid Compute Machine + * resources. + * @return the next definition stage. + */ + WithCreate withArcInstanceResourceGroup(String arcInstanceResourceGroup); + } + + /** + * The stage of the ArcSetting definition allowing to specify arcApplicationClientId. + */ + interface WithArcApplicationClientId { + /** + * Specifies the arcApplicationClientId property: App id of arc AAD identity.. + * + * @param arcApplicationClientId App id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationClientId(String arcApplicationClientId); + } + + /** + * The stage of the ArcSetting definition allowing to specify arcApplicationTenantId. + */ + interface WithArcApplicationTenantId { + /** + * Specifies the arcApplicationTenantId property: Tenant id of arc AAD identity.. + * + * @param arcApplicationTenantId Tenant id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationTenantId(String arcApplicationTenantId); + } + + /** + * The stage of the ArcSetting definition allowing to specify arcServicePrincipalObjectId. + */ + interface WithArcServicePrincipalObjectId { + /** + * Specifies the arcServicePrincipalObjectId property: Object id of arc AAD service principal.. + * + * @param arcServicePrincipalObjectId Object id of arc AAD service principal. + * @return the next definition stage. + */ + WithCreate withArcServicePrincipalObjectId(String arcServicePrincipalObjectId); + } + + /** + * The stage of the ArcSetting definition allowing to specify arcApplicationObjectId. + */ + interface WithArcApplicationObjectId { + /** + * Specifies the arcApplicationObjectId property: Object id of arc AAD identity.. + * + * @param arcApplicationObjectId Object id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationObjectId(String arcApplicationObjectId); + } + + /** + * The stage of the ArcSetting definition allowing to specify connectivityProperties. + */ + interface WithConnectivityProperties { + /** + * Specifies the connectivityProperties property: contains connectivity related configuration for ARC + * resources. + * + * @param connectivityProperties contains connectivity related configuration for ARC resources. + * @return the next definition stage. + */ + WithCreate withConnectivityProperties(Object connectivityProperties); + } + } + + /** + * Begins update for the ArcSetting resource. + * + * @return the stage of resource update. + */ + ArcSetting.Update update(); + + /** + * The template for ArcSetting update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithConnectivityProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArcSetting apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArcSetting apply(Context context); + } + + /** + * The ArcSetting update stages. + */ + interface UpdateStages { + /** + * The stage of the ArcSetting update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ArcSetting update allowing to specify connectivityProperties. + */ + interface WithConnectivityProperties { + /** + * Specifies the connectivityProperties property: contains connectivity related configuration for ARC + * resources. + * + * @param connectivityProperties contains connectivity related configuration for ARC resources. + * @return the next definition stage. + */ + Update withConnectivityProperties(Object connectivityProperties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArcSetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArcSetting refresh(Context context); + + /** + * Generate password for arc settings. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse(Context context); + + /** + * Generate password for arc settings. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PasswordCredential generatePassword(); + + /** + * Create Aad identity for arc settings. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(); + + /** + * Create Aad identity for arc settings. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + Response consentAndInstallDefaultExtensionsWithResponse(Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + ArcSetting consentAndInstallDefaultExtensions(); + + /** + * Initializes ARC Disable process on the cluster. + * + * @throws com.azure.core.management.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 initializeDisableProcess(); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java new file mode 100644 index 000000000000..e7a7f4682165 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Aggregate state of Arc agent across the nodes in this HCI cluster. + */ +public final class ArcSettingAggregateState extends ExpandableStringEnum { + /** + * Static value NotSpecified for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Error for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState ERROR = fromString("Error"); + + /** + * Static value Succeeded for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState FAILED = fromString("Failed"); + + /** + * Static value Connected for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState CONNECTED = fromString("Connected"); + + /** + * Static value Disconnected for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Deleted for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState DELETED = fromString("Deleted"); + + /** + * Static value Creating for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState CREATING = fromString("Creating"); + + /** + * Static value Updating for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState DELETING = fromString("Deleting"); + + /** + * Static value Moving for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState MOVING = fromString("Moving"); + + /** + * Static value PartiallySucceeded for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** + * Static value PartiallyConnected for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value InProgress for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Accepted for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState PROVISIONING = fromString("Provisioning"); + + /** + * Static value DisableInProgress for ArcSettingAggregateState. + */ + public static final ArcSettingAggregateState DISABLE_IN_PROGRESS = fromString("DisableInProgress"); + + /** + * Creates a new instance of ArcSettingAggregateState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArcSettingAggregateState() { + } + + /** + * Creates or finds a ArcSettingAggregateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArcSettingAggregateState. + */ + public static ArcSettingAggregateState fromString(String name) { + return fromString(name, ArcSettingAggregateState.class); + } + + /** + * Gets known ArcSettingAggregateState values. + * + * @return known ArcSettingAggregateState values. + */ + public static Collection values() { + return values(ArcSettingAggregateState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java new file mode 100644 index 000000000000..5c13d0ebace1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.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.Immutable; +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.ArcSettingInner; +import java.io.IOException; +import java.util.List; + +/** + * List of ArcSetting proxy resources for the HCI cluster. + */ +@Immutable +public final class ArcSettingList implements JsonSerializable { + /* + * List of ArcSetting proxy resources. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ArcSettingList class. + */ + public ArcSettingList() { + } + + /** + * Get the value property: List of ArcSetting proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcSettingList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcSettingList 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 ArcSettingList. + */ + public static ArcSettingList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcSettingList deserializedArcSettingList = new ArcSettingList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ArcSettingInner.fromJson(reader1)); + deserializedArcSettingList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedArcSettingList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedArcSettingList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java new file mode 100644 index 000000000000..c6bd1caac823 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ArcSettings. + */ +public interface ArcSettings { + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster. + */ + ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + Response consentAndInstallDefaultExtensionsWithResponse(String resourceGroupName, String clusterName, + String arcSettingName, Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + ArcSetting consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + ArcSetting getById(String id); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ArcSetting resource. + * + * @param name resource name. + * @return the first stage of the new ArcSetting definition. + */ + ArcSetting.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java new file mode 100644 index 000000000000..d6e1c366a560 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights 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.ArcSettingsPatchProperties; +import java.io.IOException; +import java.util.Map; + +/** + * ArcSetting details to update. + */ +@Fluent +public final class ArcSettingsPatch implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * ArcSettings properties. + */ + private ArcSettingsPatchProperties innerProperties; + + /** + * Creates an instance of ArcSettingsPatch class. + */ + public ArcSettingsPatch() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ArcSettingsPatch object itself. + */ + public ArcSettingsPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: ArcSettings properties. + * + * @return the innerProperties value. + */ + private ArcSettingsPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingsPatch object itself. + */ + public ArcSettingsPatch withConnectivityProperties(Object connectivityProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingsPatchProperties(); + } + this.innerProperties().withConnectivityProperties(connectivityProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArcSettingsPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArcSettingsPatch 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 ArcSettingsPatch. + */ + public static ArcSettingsPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArcSettingsPatch deserializedArcSettingsPatch = new ArcSettingsPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedArcSettingsPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedArcSettingsPatch.innerProperties = ArcSettingsPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedArcSettingsPatch; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java new file mode 100644 index 000000000000..27912da893e7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.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; + +/** + * Indicates the way the update content can be downloaded. + */ +public final class AvailabilityType extends ExpandableStringEnum { + /** + * Static value Local for AvailabilityType. + */ + public static final AvailabilityType LOCAL = fromString("Local"); + + /** + * Static value Online for AvailabilityType. + */ + public static final AvailabilityType ONLINE = fromString("Online"); + + /** + * Static value Notify for AvailabilityType. + */ + public static final AvailabilityType NOTIFY = fromString("Notify"); + + /** + * Creates a new instance of AvailabilityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AvailabilityType() { + } + + /** + * Creates or finds a AvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailabilityType. + */ + public static AvailabilityType fromString(String name) { + return fromString(name, AvailabilityType.class); + } + + /** + * Gets known AvailabilityType values. + * + * @return known AvailabilityType values. + */ + public static Collection values() { + return values(AvailabilityType.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 index 501aace99479..856f70e84c85 100644 --- 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 @@ -5,20 +5,25 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]. */ +/** + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]. + */ public final class CloudInitDataSource extends ExpandableStringEnum { - /** Static value NoCloud for CloudInitDataSource. */ + /** + * Static value NoCloud for CloudInitDataSource. + */ public static final CloudInitDataSource NO_CLOUD = fromString("NoCloud"); - /** Static value Azure for CloudInitDataSource. */ + /** + * 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 @@ -27,18 +32,17 @@ public CloudInitDataSource() { /** * Creates or finds a CloudInitDataSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding CloudInitDataSource. */ - @JsonCreator public static CloudInitDataSource fromString(String name) { return fromString(name, CloudInitDataSource.class); } /** * Gets known CloudInitDataSource values. - * + * * @return known CloudInitDataSource values. */ public static Collection values() { 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 new file mode 100644 index 000000000000..bbe497995eb2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java @@ -0,0 +1,692 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** + * An immutable client-side representation of Cluster. + */ +public interface Cluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + UUID principalId(); + + /** + * Gets the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + UUID tenantId(); + + /** + * Gets the typeIdentityType property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * + * @return the typeIdentityType value. + */ + ManagedServiceIdentityType typeIdentityType(); + + /** + * Gets the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + Map userAssignedIdentities(); + + /** + * Gets the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: Status of the cluster agent. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + ConnectivityStatus connectivityStatus(); + + /** + * Gets the cloudId property: Unique, immutable resource id. + * + * @return the cloudId value. + */ + String cloudId(); + + /** + * Gets the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + String cloudManagementEndpoint(); + + /** + * Gets the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + String aadClientId(); + + /** + * Gets the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * Gets the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + + /** + * Gets the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + SoftwareAssuranceProperties softwareAssuranceProperties(); + + /** + * Gets the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + ClusterDesiredProperties desiredProperties(); + + /** + * Gets the reportedProperties property: Properties reported by cluster agent. + * + * @return the reportedProperties value. + */ + ClusterReportedProperties reportedProperties(); + + /** + * Gets the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration(); + + /** + * Gets the trialDaysRemaining property: Number of days remaining in the trial period. + * + * @return the trialDaysRemaining value. + */ + Float trialDaysRemaining(); + + /** + * Gets the billingModel property: Type of billing applied to the resource. + * + * @return the billingModel value. + */ + String billingModel(); + + /** + * Gets the registrationTimestamp property: First cluster sync timestamp. + * + * @return the registrationTimestamp value. + */ + OffsetDateTime registrationTimestamp(); + + /** + * Gets the lastSyncTimestamp property: Most recent cluster sync timestamp. + * + * @return the lastSyncTimestamp value. + */ + OffsetDateTime lastSyncTimestamp(); + + /** + * Gets the lastBillingTimestamp property: Most recent billing meter timestamp. + * + * @return the lastBillingTimestamp value. + */ + OffsetDateTime lastBillingTimestamp(); + + /** + * Gets the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + String serviceEndpoint(); + + /** + * Gets the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + String resourceProviderObjectId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Cluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Cluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Cluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Cluster definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithTypeIdentityType, + DefinitionStages.WithUserAssignedIdentities, DefinitionStages.WithCloudManagementEndpoint, + DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, + DefinitionStages.WithAadApplicationObjectId, DefinitionStages.WithAadServicePrincipalObjectId, + DefinitionStages.WithSoftwareAssuranceProperties, DefinitionStages.WithDesiredProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + + /** + * The stage of the Cluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Cluster definition allowing to specify typeIdentityType. + */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of managed service identity (where both SystemAssigned and + * UserAssigned types are allowed).. + * + * @param typeIdentityType Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * @return the next definition stage. + */ + WithCreate withTypeIdentityType(ManagedServiceIdentityType typeIdentityType); + } + + /** + * The stage of the Cluster definition allowing to specify userAssignedIdentities. + */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + WithCreate withUserAssignedIdentities(Map userAssignedIdentities); + } + + /** + * The stage of the Cluster definition allowing to specify cloudManagementEndpoint. + */ + interface WithCloudManagementEndpoint { + /** + * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure + * portal.. + * + * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. + * @return the next definition stage. + */ + WithCreate withCloudManagementEndpoint(String cloudManagementEndpoint); + } + + /** + * The stage of the Cluster definition allowing to specify aadClientId. + */ + interface WithAadClientId { + /** + * Specifies the aadClientId property: App id of cluster AAD identity.. + * + * @param aadClientId App id of cluster AAD identity. + * @return the next definition stage. + */ + WithCreate withAadClientId(String aadClientId); + } + + /** + * The stage of the Cluster definition allowing to specify aadTenantId. + */ + interface WithAadTenantId { + /** + * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. + * + * @param aadTenantId Tenant id of cluster AAD identity. + * @return the next definition stage. + */ + WithCreate withAadTenantId(String aadTenantId); + } + + /** + * The stage of the Cluster definition allowing to specify aadApplicationObjectId. + */ + interface WithAadApplicationObjectId { + /** + * Specifies the aadApplicationObjectId property: Object id of cluster AAD identity.. + * + * @param aadApplicationObjectId Object id of cluster AAD identity. + * @return the next definition stage. + */ + WithCreate withAadApplicationObjectId(String aadApplicationObjectId); + } + + /** + * The stage of the Cluster definition allowing to specify aadServicePrincipalObjectId. + */ + interface WithAadServicePrincipalObjectId { + /** + * Specifies the aadServicePrincipalObjectId property: Id of cluster identity service principal.. + * + * @param aadServicePrincipalObjectId Id of cluster identity service principal. + * @return the next definition stage. + */ + WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); + } + + /** + * The stage of the Cluster definition allowing to specify softwareAssuranceProperties. + */ + interface WithSoftwareAssuranceProperties { + /** + * Specifies the softwareAssuranceProperties property: Software Assurance properties of the cluster.. + * + * @param softwareAssuranceProperties Software Assurance properties of the cluster. + * @return the next definition stage. + */ + WithCreate withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties); + } + + /** + * The stage of the Cluster definition allowing to specify desiredProperties. + */ + interface WithDesiredProperties { + /** + * Specifies the desiredProperties property: Desired properties of the cluster.. + * + * @param desiredProperties Desired properties of the cluster. + * @return the next definition stage. + */ + WithCreate withDesiredProperties(ClusterDesiredProperties desiredProperties); + } + } + + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** + * The template for Cluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithType, UpdateStages.WithUserAssignedIdentities, + UpdateStages.WithCloudManagementEndpoint, UpdateStages.WithAadClientId, UpdateStages.WithAadTenantId, + UpdateStages.WithDesiredProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + + /** + * The Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the Cluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Cluster update allowing to specify type. + */ + interface WithType { + /** + * Specifies the type property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed).. + * + * @param type Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * @return the next definition stage. + */ + Update withType(ManagedServiceIdentityType type); + } + + /** + * The stage of the Cluster update allowing to specify userAssignedIdentities. + */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + Update withUserAssignedIdentities(Map userAssignedIdentities); + } + + /** + * The stage of the Cluster update allowing to specify cloudManagementEndpoint. + */ + interface WithCloudManagementEndpoint { + /** + * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. + * @return the next definition stage. + */ + Update withCloudManagementEndpoint(String cloudManagementEndpoint); + } + + /** + * The stage of the Cluster update allowing to specify aadClientId. + */ + interface WithAadClientId { + /** + * Specifies the aadClientId property: App id of cluster AAD identity.. + * + * @param aadClientId App id of cluster AAD identity. + * @return the next definition stage. + */ + Update withAadClientId(String aadClientId); + } + + /** + * The stage of the Cluster update allowing to specify aadTenantId. + */ + interface WithAadTenantId { + /** + * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. + * + * @param aadTenantId Tenant id of cluster AAD identity. + * @return the next definition stage. + */ + Update withAadTenantId(String aadTenantId); + } + + /** + * The stage of the Cluster update allowing to specify desiredProperties. + */ + interface WithDesiredProperties { + /** + * Specifies the desiredProperties property: Desired properties of the cluster.. + * + * @param desiredProperties Desired properties of the cluster. + * @return the next definition stage. + */ + Update withDesiredProperties(ClusterDesiredProperties desiredProperties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Create cluster identity. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(); + + /** + * Create cluster identity. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java new file mode 100644 index 000000000000..1d8108f674f7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.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; + +/** + * Desired properties of the cluster. + */ +@Fluent +public final class ClusterDesiredProperties implements JsonSerializable { + /* + * Desired state of Windows Server Subscription. + */ + private WindowsServerSubscription windowsServerSubscription; + + /* + * Desired level of diagnostic data emitted by the cluster. + */ + private DiagnosticLevel diagnosticLevel; + + /** + * Creates an instance of ClusterDesiredProperties class. + */ + public ClusterDesiredProperties() { + } + + /** + * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. + * + * @return the windowsServerSubscription value. + */ + public WindowsServerSubscription windowsServerSubscription() { + return this.windowsServerSubscription; + } + + /** + * Set the windowsServerSubscription property: Desired state of Windows Server Subscription. + * + * @param windowsServerSubscription the windowsServerSubscription value to set. + * @return the ClusterDesiredProperties object itself. + */ + public ClusterDesiredProperties withWindowsServerSubscription(WindowsServerSubscription windowsServerSubscription) { + this.windowsServerSubscription = windowsServerSubscription; + return this; + } + + /** + * Get the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. + * + * @return the diagnosticLevel value. + */ + public DiagnosticLevel diagnosticLevel() { + return this.diagnosticLevel; + } + + /** + * Set the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. + * + * @param diagnosticLevel the diagnosticLevel value to set. + * @return the ClusterDesiredProperties object itself. + */ + public ClusterDesiredProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { + this.diagnosticLevel = diagnosticLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("windowsServerSubscription", + this.windowsServerSubscription == null ? null : this.windowsServerSubscription.toString()); + jsonWriter.writeStringField("diagnosticLevel", + this.diagnosticLevel == null ? null : this.diagnosticLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterDesiredProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterDesiredProperties 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 ClusterDesiredProperties. + */ + public static ClusterDesiredProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterDesiredProperties deserializedClusterDesiredProperties = new ClusterDesiredProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("windowsServerSubscription".equals(fieldName)) { + deserializedClusterDesiredProperties.windowsServerSubscription + = WindowsServerSubscription.fromString(reader.getString()); + } else if ("diagnosticLevel".equals(fieldName)) { + deserializedClusterDesiredProperties.diagnosticLevel + = DiagnosticLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterDesiredProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java new file mode 100644 index 000000000000..0def28f160e2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; + +/** + * An immutable client-side representation of ClusterIdentityResponse. + */ +public interface ClusterIdentityResponse { + /** + * Gets the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + String aadClientId(); + + /** + * Gets the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * Gets the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + + /** + * Gets the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner object. + * + * @return the inner object. + */ + ClusterIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java new file mode 100644 index 000000000000..326fa1b0b8b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.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.ClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * List of clusters. + */ +@Fluent +public final class ClusterList implements JsonSerializable { + /* + * List of clusters. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ClusterList class. + */ + public ClusterList() { + } + + /** + * Get the value property: List of clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of clusters. + * + * @param value the value value to set. + * @return the ClusterList object itself. + */ + public ClusterList 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 ClusterList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterList 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 ClusterList. + */ + public static ClusterList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterList deserializedClusterList = new ClusterList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterInner.fromJson(reader1)); + deserializedClusterList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java new file mode 100644 index 000000000000..efbcc29e5f06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * Cluster node details. + */ +@Immutable +public final class ClusterNode implements JsonSerializable { + /* + * Name of the cluster node. + */ + private String name; + + /* + * Id of the node in the cluster. + */ + private Float id; + + /* + * State of Windows Server Subscription. + */ + private WindowsServerSubscription windowsServerSubscription; + + /* + * Type of the cluster node hardware. + */ + private ClusterNodeType nodeType; + + /* + * Edge Hardware Center Resource Id + */ + private String ehcResourceId; + + /* + * Manufacturer of the cluster node hardware. + */ + private String manufacturer; + + /* + * Model name of the cluster node hardware. + */ + private String model; + + /* + * Operating system running on the cluster node. + */ + private String osName; + + /* + * Version of the operating system running on the cluster node. + */ + private String osVersion; + + /* + * Display version of the operating system running on the cluster node. + */ + private String osDisplayVersion; + + /* + * Immutable id of the cluster node. + */ + private String serialNumber; + + /* + * Number of physical cores on the cluster node. + */ + private Float coreCount; + + /* + * Total available memory on the cluster node (in GiB). + */ + private Float memoryInGiB; + + /* + * Most recent licensing timestamp. + */ + private OffsetDateTime lastLicensingTimestamp; + + /* + * OEM activation status of the node. + */ + private OemActivation oemActivation; + + /** + * Creates an instance of ClusterNode class. + */ + public ClusterNode() { + } + + /** + * Get the name property: Name of the cluster node. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: Id of the node in the cluster. + * + * @return the id value. + */ + public Float id() { + return this.id; + } + + /** + * Get the windowsServerSubscription property: State of Windows Server Subscription. + * + * @return the windowsServerSubscription value. + */ + public WindowsServerSubscription windowsServerSubscription() { + return this.windowsServerSubscription; + } + + /** + * Get the nodeType property: Type of the cluster node hardware. + * + * @return the nodeType value. + */ + public ClusterNodeType nodeType() { + return this.nodeType; + } + + /** + * Get the ehcResourceId property: Edge Hardware Center Resource Id. + * + * @return the ehcResourceId value. + */ + public String ehcResourceId() { + return this.ehcResourceId; + } + + /** + * Get the manufacturer property: Manufacturer of the cluster node hardware. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.manufacturer; + } + + /** + * Get the model property: Model name of the cluster node hardware. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Get the osName property: Operating system running on the cluster node. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the osVersion property: Version of the operating system running on the cluster node. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get the osDisplayVersion property: Display version of the operating system running on the cluster node. + * + * @return the osDisplayVersion value. + */ + public String osDisplayVersion() { + return this.osDisplayVersion; + } + + /** + * Get the serialNumber property: Immutable id of the cluster node. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the coreCount property: Number of physical cores on the cluster node. + * + * @return the coreCount value. + */ + public Float coreCount() { + return this.coreCount; + } + + /** + * Get the memoryInGiB property: Total available memory on the cluster node (in GiB). + * + * @return the memoryInGiB value. + */ + public Float memoryInGiB() { + return this.memoryInGiB; + } + + /** + * Get the lastLicensingTimestamp property: Most recent licensing timestamp. + * + * @return the lastLicensingTimestamp value. + */ + public OffsetDateTime lastLicensingTimestamp() { + return this.lastLicensingTimestamp; + } + + /** + * Get the oemActivation property: OEM activation status of the node. + * + * @return the oemActivation value. + */ + public OemActivation oemActivation() { + return this.oemActivation; + } + + /** + * 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 ClusterNode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterNode 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 ClusterNode. + */ + public static ClusterNode fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterNode deserializedClusterNode = new ClusterNode(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClusterNode.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedClusterNode.id = reader.getNullable(JsonReader::getFloat); + } else if ("windowsServerSubscription".equals(fieldName)) { + deserializedClusterNode.windowsServerSubscription + = WindowsServerSubscription.fromString(reader.getString()); + } else if ("nodeType".equals(fieldName)) { + deserializedClusterNode.nodeType = ClusterNodeType.fromString(reader.getString()); + } else if ("ehcResourceId".equals(fieldName)) { + deserializedClusterNode.ehcResourceId = reader.getString(); + } else if ("manufacturer".equals(fieldName)) { + deserializedClusterNode.manufacturer = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedClusterNode.model = reader.getString(); + } else if ("osName".equals(fieldName)) { + deserializedClusterNode.osName = reader.getString(); + } else if ("osVersion".equals(fieldName)) { + deserializedClusterNode.osVersion = reader.getString(); + } else if ("osDisplayVersion".equals(fieldName)) { + deserializedClusterNode.osDisplayVersion = reader.getString(); + } else if ("serialNumber".equals(fieldName)) { + deserializedClusterNode.serialNumber = reader.getString(); + } else if ("coreCount".equals(fieldName)) { + deserializedClusterNode.coreCount = reader.getNullable(JsonReader::getFloat); + } else if ("memoryInGiB".equals(fieldName)) { + deserializedClusterNode.memoryInGiB = reader.getNullable(JsonReader::getFloat); + } else if ("lastLicensingTimestamp".equals(fieldName)) { + deserializedClusterNode.lastLicensingTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("oemActivation".equals(fieldName)) { + deserializedClusterNode.oemActivation = OemActivation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterNode; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java new file mode 100644 index 000000000000..dfbab1e8db5f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.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 node type of all the nodes of the cluster. + */ +public final class ClusterNodeType extends ExpandableStringEnum { + /** + * Static value FirstParty for ClusterNodeType. + */ + public static final ClusterNodeType FIRST_PARTY = fromString("FirstParty"); + + /** + * Static value ThirdParty for ClusterNodeType. + */ + public static final ClusterNodeType THIRD_PARTY = fromString("ThirdParty"); + + /** + * Creates a new instance of ClusterNodeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterNodeType() { + } + + /** + * Creates or finds a ClusterNodeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterNodeType. + */ + public static ClusterNodeType fromString(String name) { + return fromString(name, ClusterNodeType.class); + } + + /** + * Gets known ClusterNodeType values. + * + * @return known ClusterNodeType values. + */ + public static Collection values() { + return values(ClusterNodeType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java new file mode 100644 index 000000000000..660365b821e4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.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.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.ClusterPatchProperties; +import com.azure.resourcemanager.azurestackhci.fluent.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Cluster details to update. + */ +@Fluent +public final class ClusterPatch implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * Identity of Cluster resource + */ + private ManagedServiceIdentity innerIdentity; + + /* + * Cluster properties. + */ + private ClusterPatchProperties innerProperties; + + /** + * Creates an instance of ClusterPatch class. + */ + public ClusterPatch() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerIdentity property: Identity of Cluster resource. + * + * @return the innerIdentity value. + */ + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; + } + + /** + * Get the innerProperties property: Cluster properties. + * + * @return the innerProperties value. + */ + private ClusterPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withDesiredProperties(desiredProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.innerIdentity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatch 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 ClusterPatch. + */ + public static ClusterPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatch deserializedClusterPatch = new ClusterPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterPatch.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedClusterPatch.innerIdentity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterPatch.innerProperties = ClusterPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatch; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java new file mode 100644 index 000000000000..2643f6e52e8b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights 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.util.List; + +/** + * Properties reported by cluster agent. + */ +@Fluent +public final class ClusterReportedProperties implements JsonSerializable { + /* + * Name of the on-prem cluster connected to this resource. + */ + private String clusterName; + + /* + * Unique id generated by the on-prem cluster. + */ + private String clusterId; + + /* + * Version of the cluster software. + */ + private String clusterVersion; + + /* + * List of nodes reported by the cluster. + */ + private List nodes; + + /* + * Last time the cluster reported the data. + */ + private OffsetDateTime lastUpdated; + + /* + * IMDS attestation status of the cluster. + */ + private ImdsAttestation imdsAttestation; + + /* + * Level of diagnostic data emitted by the cluster. + */ + private DiagnosticLevel diagnosticLevel; + + /* + * Capabilities supported by the cluster. + */ + private List supportedCapabilities; + + /* + * The node type of all the nodes of the cluster. + */ + private ClusterNodeType clusterType; + + /* + * The manufacturer of all the nodes of the cluster. + */ + private String manufacturer; + + /* + * OEM activation status of the cluster. + */ + private OemActivation oemActivation; + + /** + * Creates an instance of ClusterReportedProperties class. + */ + public ClusterReportedProperties() { + } + + /** + * Get the clusterName property: Name of the on-prem cluster connected to this resource. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Get the clusterId property: Unique id generated by the on-prem cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the clusterVersion property: Version of the cluster software. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Get the nodes property: List of nodes reported by the cluster. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Get the lastUpdated property: Last time the cluster reported the data. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Get the imdsAttestation property: IMDS attestation status of the cluster. + * + * @return the imdsAttestation value. + */ + public ImdsAttestation imdsAttestation() { + return this.imdsAttestation; + } + + /** + * Get the diagnosticLevel property: Level of diagnostic data emitted by the cluster. + * + * @return the diagnosticLevel value. + */ + public DiagnosticLevel diagnosticLevel() { + return this.diagnosticLevel; + } + + /** + * Set the diagnosticLevel property: Level of diagnostic data emitted by the cluster. + * + * @param diagnosticLevel the diagnosticLevel value to set. + * @return the ClusterReportedProperties object itself. + */ + public ClusterReportedProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { + this.diagnosticLevel = diagnosticLevel; + return this; + } + + /** + * Get the supportedCapabilities property: Capabilities supported by the cluster. + * + * @return the supportedCapabilities value. + */ + public List supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Get the clusterType property: The node type of all the nodes of the cluster. + * + * @return the clusterType value. + */ + public ClusterNodeType clusterType() { + return this.clusterType; + } + + /** + * Get the manufacturer property: The manufacturer of all the nodes of the cluster. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.manufacturer; + } + + /** + * Get the oemActivation property: OEM activation status of the cluster. + * + * @return the oemActivation value. + */ + public OemActivation oemActivation() { + return this.oemActivation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("diagnosticLevel", + this.diagnosticLevel == null ? null : this.diagnosticLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterReportedProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterReportedProperties 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 ClusterReportedProperties. + */ + public static ClusterReportedProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterReportedProperties deserializedClusterReportedProperties = new ClusterReportedProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterName".equals(fieldName)) { + deserializedClusterReportedProperties.clusterName = reader.getString(); + } else if ("clusterId".equals(fieldName)) { + deserializedClusterReportedProperties.clusterId = reader.getString(); + } else if ("clusterVersion".equals(fieldName)) { + deserializedClusterReportedProperties.clusterVersion = reader.getString(); + } else if ("nodes".equals(fieldName)) { + List nodes = reader.readArray(reader1 -> ClusterNode.fromJson(reader1)); + deserializedClusterReportedProperties.nodes = nodes; + } else if ("lastUpdated".equals(fieldName)) { + deserializedClusterReportedProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("imdsAttestation".equals(fieldName)) { + deserializedClusterReportedProperties.imdsAttestation + = ImdsAttestation.fromString(reader.getString()); + } else if ("diagnosticLevel".equals(fieldName)) { + deserializedClusterReportedProperties.diagnosticLevel + = DiagnosticLevel.fromString(reader.getString()); + } else if ("supportedCapabilities".equals(fieldName)) { + List supportedCapabilities = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterReportedProperties.supportedCapabilities = supportedCapabilities; + } else if ("clusterType".equals(fieldName)) { + deserializedClusterReportedProperties.clusterType = ClusterNodeType.fromString(reader.getString()); + } else if ("manufacturer".equals(fieldName)) { + deserializedClusterReportedProperties.manufacturer = reader.getString(); + } else if ("oemActivation".equals(fieldName)) { + deserializedClusterReportedProperties.oemActivation = OemActivation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterReportedProperties; + }); + } +} 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 new file mode 100644 index 000000000000..401bc48a9273 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights 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 Clusters. + */ +public interface Clusters { + /** + * List all HCI clusters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all HCI clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List all HCI clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of clusters as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all HCI clusters in a resource group. + * + * @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 clusters as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(String resourceGroupName, String clusterName, + UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change 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 extendSoftwareAssuranceBenefit(String resourceGroupName, String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); + + /** + * Get HCI cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response}. + */ + Cluster getById(String id); + + /** + * Get HCI cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hCI cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an HCI cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an HCI cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceAssignmentType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceAssignmentType.java new file mode 100644 index 000000000000..bb97b08713ed --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceAssignmentType.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; + +/** + * Represents the compliance assignment type of a resource. + */ +public final class ComplianceAssignmentType extends ExpandableStringEnum { + /** + * Static value Audit for ComplianceAssignmentType. + */ + public static final ComplianceAssignmentType AUDIT = fromString("Audit"); + + /** + * Static value ApplyAndAutoCorrect for ComplianceAssignmentType. + */ + public static final ComplianceAssignmentType APPLY_AND_AUTO_CORRECT = fromString("ApplyAndAutoCorrect"); + + /** + * Creates a new instance of ComplianceAssignmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComplianceAssignmentType() { + } + + /** + * Creates or finds a ComplianceAssignmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComplianceAssignmentType. + */ + public static ComplianceAssignmentType fromString(String name) { + return fromString(name, ComplianceAssignmentType.class); + } + + /** + * Gets known ComplianceAssignmentType values. + * + * @return known ComplianceAssignmentType values. + */ + public static Collection values() { + return values(ComplianceAssignmentType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceStatus.java new file mode 100644 index 000000000000..96b3f164fd21 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComplianceStatus.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; + +/** + * Represents the compliance status of a resource. + */ +public final class ComplianceStatus extends ExpandableStringEnum { + /** + * Static value Compliant for ComplianceStatus. + */ + public static final ComplianceStatus COMPLIANT = fromString("Compliant"); + + /** + * Static value NonCompliant for ComplianceStatus. + */ + public static final ComplianceStatus NON_COMPLIANT = fromString("NonCompliant"); + + /** + * Static value Pending for ComplianceStatus. + */ + public static final ComplianceStatus PENDING = fromString("Pending"); + + /** + * Creates a new instance of ComplianceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComplianceStatus() { + } + + /** + * Creates or finds a ComplianceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComplianceStatus. + */ + public static ComplianceStatus fromString(String name) { + return fromString(name, ComplianceStatus.class); + } + + /** + * Gets known ComplianceStatus values. + * + * @return known ComplianceStatus values. + */ + public static Collection values() { + return values(ComplianceStatus.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java new file mode 100644 index 000000000000..ffab5014fd02 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.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; + +/** + * Overall connectivity status for the cluster resource. + */ +public final class ConnectivityStatus extends ExpandableStringEnum { + /** + * Static value NotYetRegistered for ConnectivityStatus. + */ + public static final ConnectivityStatus NOT_YET_REGISTERED = fromString("NotYetRegistered"); + + /** + * Static value Connected for ConnectivityStatus. + */ + public static final ConnectivityStatus CONNECTED = fromString("Connected"); + + /** + * Static value NotConnectedRecently for ConnectivityStatus. + */ + public static final ConnectivityStatus NOT_CONNECTED_RECENTLY = fromString("NotConnectedRecently"); + + /** + * Static value PartiallyConnected for ConnectivityStatus. + */ + public static final ConnectivityStatus PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value Disconnected for ConnectivityStatus. + */ + public static final ConnectivityStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Static value NotSpecified for ConnectivityStatus. + */ + public static final ConnectivityStatus NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates a new instance of ConnectivityStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectivityStatus() { + } + + /** + * Creates or finds a ConnectivityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityStatus. + */ + public static ConnectivityStatus fromString(String name) { + return fromString(name, ConnectivityStatus.class); + } + + /** + * Gets known ConnectivityStatus values. + * + * @return known ConnectivityStatus values. + */ + public static Collection values() { + return values(ConnectivityStatus.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java new file mode 100644 index 000000000000..9b85e3f4587c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.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.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; + +/** + * Properties for a particular default extension category. + */ +@Immutable +public final class DefaultExtensionDetails implements JsonSerializable { + /* + * Default extension category + */ + private String category; + + /* + * Consent time for extension category + */ + private OffsetDateTime consentTime; + + /** + * Creates an instance of DefaultExtensionDetails class. + */ + public DefaultExtensionDetails() { + } + + /** + * Get the category property: Default extension category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the consentTime property: Consent time for extension category. + * + * @return the consentTime value. + */ + public OffsetDateTime consentTime() { + return this.consentTime; + } + + /** + * 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 DefaultExtensionDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultExtensionDetails 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 DefaultExtensionDetails. + */ + public static DefaultExtensionDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultExtensionDetails deserializedDefaultExtensionDetails = new DefaultExtensionDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedDefaultExtensionDetails.category = reader.getString(); + } else if ("consentTime".equals(fieldName)) { + deserializedDefaultExtensionDetails.consentTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultExtensionDetails; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentCluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentCluster.java new file mode 100644 index 000000000000..b0b7a7da1ce2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentCluster.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * AzureStackHCI Cluster deployment properties. + */ +@Fluent +public final class DeploymentCluster implements JsonSerializable { + /* + * The cluster name provided when preparing Active Directory. + */ + private String name; + + /* + * Use a cloud witness if you have internet access and if you use an Azure Storage account to provide a vote on + * cluster quorum. A cloud witness uses Azure Blob Storage to read or write a blob file and then uses it to + * arbitrate in split-brain resolution. Only allowed values are 'Cloud', 'FileShare'. + */ + private String witnessType; + + /* + * Specify the fileshare path for the local witness for your Azure Stack HCI cluster. + */ + private String witnessPath; + + /* + * Specify the Azure Storage account name for cloud witness for your Azure Stack HCI cluster. + */ + private String cloudAccountName; + + /* + * For Azure blob service endpoint type, select either Default or Custom domain. If you selected **Custom domain, + * enter the domain for the blob service in this format core.windows.net. + */ + private String azureServiceEndpoint; + + /** + * Creates an instance of DeploymentCluster class. + */ + public DeploymentCluster() { + } + + /** + * Get the name property: The cluster name provided when preparing Active Directory. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The cluster name provided when preparing Active Directory. + * + * @param name the name value to set. + * @return the DeploymentCluster object itself. + */ + public DeploymentCluster withName(String name) { + this.name = name; + return this; + } + + /** + * Get the witnessType property: Use a cloud witness if you have internet access and if you use an Azure Storage + * account to provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to read or write a blob file + * and then uses it to arbitrate in split-brain resolution. Only allowed values are 'Cloud', 'FileShare'. + * + * @return the witnessType value. + */ + public String witnessType() { + return this.witnessType; + } + + /** + * Set the witnessType property: Use a cloud witness if you have internet access and if you use an Azure Storage + * account to provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to read or write a blob file + * and then uses it to arbitrate in split-brain resolution. Only allowed values are 'Cloud', 'FileShare'. + * + * @param witnessType the witnessType value to set. + * @return the DeploymentCluster object itself. + */ + public DeploymentCluster withWitnessType(String witnessType) { + this.witnessType = witnessType; + return this; + } + + /** + * Get the witnessPath property: Specify the fileshare path for the local witness for your Azure Stack HCI cluster. + * + * @return the witnessPath value. + */ + public String witnessPath() { + return this.witnessPath; + } + + /** + * Set the witnessPath property: Specify the fileshare path for the local witness for your Azure Stack HCI cluster. + * + * @param witnessPath the witnessPath value to set. + * @return the DeploymentCluster object itself. + */ + public DeploymentCluster withWitnessPath(String witnessPath) { + this.witnessPath = witnessPath; + return this; + } + + /** + * Get the cloudAccountName property: Specify the Azure Storage account name for cloud witness for your Azure Stack + * HCI cluster. + * + * @return the cloudAccountName value. + */ + public String cloudAccountName() { + return this.cloudAccountName; + } + + /** + * Set the cloudAccountName property: Specify the Azure Storage account name for cloud witness for your Azure Stack + * HCI cluster. + * + * @param cloudAccountName the cloudAccountName value to set. + * @return the DeploymentCluster object itself. + */ + public DeploymentCluster withCloudAccountName(String cloudAccountName) { + this.cloudAccountName = cloudAccountName; + return this; + } + + /** + * Get the azureServiceEndpoint property: For Azure blob service endpoint type, select either Default or Custom + * domain. If you selected **Custom domain, enter the domain for the blob service in this format core.windows.net. + * + * @return the azureServiceEndpoint value. + */ + public String azureServiceEndpoint() { + return this.azureServiceEndpoint; + } + + /** + * Set the azureServiceEndpoint property: For Azure blob service endpoint type, select either Default or Custom + * domain. If you selected **Custom domain, enter the domain for the blob service in this format core.windows.net. + * + * @param azureServiceEndpoint the azureServiceEndpoint value to set. + * @return the DeploymentCluster object itself. + */ + public DeploymentCluster withAzureServiceEndpoint(String azureServiceEndpoint) { + this.azureServiceEndpoint = azureServiceEndpoint; + 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("name", this.name); + jsonWriter.writeStringField("witnessType", this.witnessType); + jsonWriter.writeStringField("witnessPath", this.witnessPath); + jsonWriter.writeStringField("cloudAccountName", this.cloudAccountName); + jsonWriter.writeStringField("azureServiceEndpoint", this.azureServiceEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentCluster from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentCluster 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 DeploymentCluster. + */ + public static DeploymentCluster fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentCluster deserializedDeploymentCluster = new DeploymentCluster(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeploymentCluster.name = reader.getString(); + } else if ("witnessType".equals(fieldName)) { + deserializedDeploymentCluster.witnessType = reader.getString(); + } else if ("witnessPath".equals(fieldName)) { + deserializedDeploymentCluster.witnessPath = reader.getString(); + } else if ("cloudAccountName".equals(fieldName)) { + deserializedDeploymentCluster.cloudAccountName = reader.getString(); + } else if ("azureServiceEndpoint".equals(fieldName)) { + deserializedDeploymentCluster.azureServiceEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentCluster; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentConfiguration.java new file mode 100644 index 000000000000..d575cd1e0d9d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentConfiguration.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 java.io.IOException; +import java.util.List; + +/** + * Deployment Configuration. + */ +@Fluent +public final class DeploymentConfiguration implements JsonSerializable { + /* + * deployment template version + */ + private String version; + + /* + * Scale units will contains list of deployment data + */ + private List scaleUnits; + + /** + * Creates an instance of DeploymentConfiguration class. + */ + public DeploymentConfiguration() { + } + + /** + * Get the version property: deployment template version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: deployment template version. + * + * @param version the version value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the scaleUnits property: Scale units will contains list of deployment data. + * + * @return the scaleUnits value. + */ + public List scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the scaleUnits property: Scale units will contains list of deployment data. + * + * @param scaleUnits the scaleUnits value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withScaleUnits(List scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleUnits() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scaleUnits in model DeploymentConfiguration")); + } else { + scaleUnits().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("scaleUnits", this.scaleUnits, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentConfiguration 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 DeploymentConfiguration. + */ + public static DeploymentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentConfiguration deserializedDeploymentConfiguration = new DeploymentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleUnits".equals(fieldName)) { + List scaleUnits = reader.readArray(reader1 -> ScaleUnits.fromJson(reader1)); + deserializedDeploymentConfiguration.scaleUnits = scaleUnits; + } else if ("version".equals(fieldName)) { + deserializedDeploymentConfiguration.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentConfiguration; + }); + } +} 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 new file mode 100644 index 000000000000..411318496004 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentData.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights 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 Deployment data of AzureStackHCI Cluster. + */ +@Fluent +public final class DeploymentData implements JsonSerializable { + /* + * SecuritySettings to deploy AzureStackHCI Cluster. + */ + private DeploymentSecuritySettings securitySettings; + + /* + * Observability config to deploy AzureStackHCI Cluster. + */ + private Observability observability; + + /* + * Observability config to deploy AzureStackHCI Cluster. + */ + private DeploymentCluster cluster; + + /* + * Storage config to deploy AzureStackHCI Cluster. + */ + private Storage storage; + + /* + * naming prefix to deploy cluster. + */ + private String namingPrefix; + + /* + * FQDN to deploy cluster + */ + private String domainFqdn; + + /* + * InfrastructureNetwork config to deploy AzureStackHCI Cluster. + */ + private List infrastructureNetwork; + + /* + * list of physical nodes config to deploy AzureStackHCI Cluster. + */ + private List physicalNodes; + + /* + * HostNetwork config to deploy AzureStackHCI Cluster. + */ + private HostNetwork hostNetwork; + + /* + * The path to the Active Directory Organizational Unit container object prepared for the deployment. + */ + private String adouPath; + + /* + * The URI to the keyvault / secret store. + */ + private String secretsLocation; + + /* + * OptionalServices config to deploy AzureStackHCI Cluster. + */ + private OptionalServices optionalServices; + + /** + * Creates an instance of DeploymentData class. + */ + public DeploymentData() { + } + + /** + * Get the securitySettings property: SecuritySettings to deploy AzureStackHCI Cluster. + * + * @return the securitySettings value. + */ + public DeploymentSecuritySettings securitySettings() { + return this.securitySettings; + } + + /** + * Set the securitySettings property: SecuritySettings to deploy AzureStackHCI Cluster. + * + * @param securitySettings the securitySettings value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withSecuritySettings(DeploymentSecuritySettings securitySettings) { + this.securitySettings = securitySettings; + return this; + } + + /** + * Get the observability property: Observability config to deploy AzureStackHCI Cluster. + * + * @return the observability value. + */ + public Observability observability() { + return this.observability; + } + + /** + * Set the observability property: Observability config to deploy AzureStackHCI Cluster. + * + * @param observability the observability value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withObservability(Observability observability) { + this.observability = observability; + return this; + } + + /** + * Get the cluster property: Observability config to deploy AzureStackHCI Cluster. + * + * @return the cluster value. + */ + public DeploymentCluster cluster() { + return this.cluster; + } + + /** + * Set the cluster property: Observability config to deploy AzureStackHCI Cluster. + * + * @param cluster the cluster value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withCluster(DeploymentCluster cluster) { + this.cluster = cluster; + return this; + } + + /** + * Get the storage property: Storage config to deploy AzureStackHCI Cluster. + * + * @return the storage value. + */ + public Storage storage() { + return this.storage; + } + + /** + * Set the storage property: Storage config to deploy AzureStackHCI Cluster. + * + * @param storage the storage value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withStorage(Storage storage) { + this.storage = storage; + return this; + } + + /** + * Get the namingPrefix property: naming prefix to deploy cluster. + * + * @return the namingPrefix value. + */ + public String namingPrefix() { + return this.namingPrefix; + } + + /** + * Set the namingPrefix property: naming prefix to deploy cluster. + * + * @param namingPrefix the namingPrefix value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withNamingPrefix(String namingPrefix) { + this.namingPrefix = namingPrefix; + return this; + } + + /** + * Get the domainFqdn property: FQDN to deploy cluster. + * + * @return the domainFqdn value. + */ + public String domainFqdn() { + return this.domainFqdn; + } + + /** + * Set the domainFqdn property: FQDN to deploy cluster. + * + * @param domainFqdn the domainFqdn value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withDomainFqdn(String domainFqdn) { + this.domainFqdn = domainFqdn; + return this; + } + + /** + * Get the infrastructureNetwork property: InfrastructureNetwork config to deploy AzureStackHCI Cluster. + * + * @return the infrastructureNetwork value. + */ + public List infrastructureNetwork() { + return this.infrastructureNetwork; + } + + /** + * Set the infrastructureNetwork property: InfrastructureNetwork config to deploy AzureStackHCI Cluster. + * + * @param infrastructureNetwork the infrastructureNetwork value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withInfrastructureNetwork(List infrastructureNetwork) { + this.infrastructureNetwork = infrastructureNetwork; + return this; + } + + /** + * Get the physicalNodes property: list of physical nodes config to deploy AzureStackHCI Cluster. + * + * @return the physicalNodes value. + */ + public List physicalNodes() { + return this.physicalNodes; + } + + /** + * Set the physicalNodes property: list of physical nodes config to deploy AzureStackHCI Cluster. + * + * @param physicalNodes the physicalNodes value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withPhysicalNodes(List physicalNodes) { + this.physicalNodes = physicalNodes; + return this; + } + + /** + * Get the hostNetwork property: HostNetwork config to deploy AzureStackHCI Cluster. + * + * @return the hostNetwork value. + */ + public HostNetwork hostNetwork() { + return this.hostNetwork; + } + + /** + * Set the hostNetwork property: HostNetwork config to deploy AzureStackHCI Cluster. + * + * @param hostNetwork the hostNetwork value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withHostNetwork(HostNetwork hostNetwork) { + this.hostNetwork = hostNetwork; + return this; + } + + /** + * Get the adouPath property: The path to the Active Directory Organizational Unit container object prepared for the + * deployment. + * + * @return the adouPath value. + */ + public String adouPath() { + return this.adouPath; + } + + /** + * Set the adouPath property: The path to the Active Directory Organizational Unit container object prepared for the + * deployment. + * + * @param adouPath the adouPath value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withAdouPath(String adouPath) { + this.adouPath = adouPath; + return this; + } + + /** + * Get the secretsLocation property: The URI to the keyvault / secret store. + * + * @return the secretsLocation value. + */ + public String secretsLocation() { + return this.secretsLocation; + } + + /** + * Set the secretsLocation property: The URI to the keyvault / secret store. + * + * @param secretsLocation the secretsLocation value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withSecretsLocation(String secretsLocation) { + this.secretsLocation = secretsLocation; + return this; + } + + /** + * Get the optionalServices property: OptionalServices config to deploy AzureStackHCI Cluster. + * + * @return the optionalServices value. + */ + public OptionalServices optionalServices() { + return this.optionalServices; + } + + /** + * Set the optionalServices property: OptionalServices config to deploy AzureStackHCI Cluster. + * + * @param optionalServices the optionalServices value to set. + * @return the DeploymentData object itself. + */ + public DeploymentData withOptionalServices(OptionalServices optionalServices) { + this.optionalServices = optionalServices; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securitySettings() != null) { + securitySettings().validate(); + } + if (observability() != null) { + observability().validate(); + } + if (cluster() != null) { + cluster().validate(); + } + if (storage() != null) { + storage().validate(); + } + if (infrastructureNetwork() != null) { + infrastructureNetwork().forEach(e -> e.validate()); + } + if (physicalNodes() != null) { + physicalNodes().forEach(e -> e.validate()); + } + if (hostNetwork() != null) { + hostNetwork().validate(); + } + if (optionalServices() != null) { + optionalServices().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("securitySettings", this.securitySettings); + jsonWriter.writeJsonField("observability", this.observability); + jsonWriter.writeJsonField("cluster", this.cluster); + jsonWriter.writeJsonField("storage", this.storage); + jsonWriter.writeStringField("namingPrefix", this.namingPrefix); + jsonWriter.writeStringField("domainFqdn", this.domainFqdn); + jsonWriter.writeArrayField("infrastructureNetwork", this.infrastructureNetwork, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("physicalNodes", this.physicalNodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("hostNetwork", this.hostNetwork); + jsonWriter.writeStringField("adouPath", this.adouPath); + jsonWriter.writeStringField("secretsLocation", this.secretsLocation); + jsonWriter.writeJsonField("optionalServices", this.optionalServices); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentData 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 DeploymentData. + */ + public static DeploymentData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentData deserializedDeploymentData = new DeploymentData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securitySettings".equals(fieldName)) { + deserializedDeploymentData.securitySettings = DeploymentSecuritySettings.fromJson(reader); + } else if ("observability".equals(fieldName)) { + deserializedDeploymentData.observability = Observability.fromJson(reader); + } else if ("cluster".equals(fieldName)) { + deserializedDeploymentData.cluster = DeploymentCluster.fromJson(reader); + } else if ("storage".equals(fieldName)) { + deserializedDeploymentData.storage = Storage.fromJson(reader); + } else if ("namingPrefix".equals(fieldName)) { + deserializedDeploymentData.namingPrefix = reader.getString(); + } else if ("domainFqdn".equals(fieldName)) { + deserializedDeploymentData.domainFqdn = reader.getString(); + } else if ("infrastructureNetwork".equals(fieldName)) { + List infrastructureNetwork + = reader.readArray(reader1 -> InfrastructureNetwork.fromJson(reader1)); + deserializedDeploymentData.infrastructureNetwork = infrastructureNetwork; + } else if ("physicalNodes".equals(fieldName)) { + List physicalNodes = reader.readArray(reader1 -> PhysicalNodes.fromJson(reader1)); + deserializedDeploymentData.physicalNodes = physicalNodes; + } else if ("hostNetwork".equals(fieldName)) { + 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 ("optionalServices".equals(fieldName)) { + deserializedDeploymentData.optionalServices = OptionalServices.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentData; + }); + } +} 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 new file mode 100644 index 000000000000..d1836b4c1f9f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentMode.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 deployment mode for cluster deployment. + */ +public final class DeploymentMode extends ExpandableStringEnum { + /** + * Static value Validate for DeploymentMode. + */ + public static final DeploymentMode VALIDATE = fromString("Validate"); + + /** + * Static value Deploy for DeploymentMode. + */ + public static final DeploymentMode DEPLOY = fromString("Deploy"); + + /** + * Creates a new instance of DeploymentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentMode() { + } + + /** + * Creates or finds a DeploymentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentMode. + */ + public static DeploymentMode fromString(String name) { + return fromString(name, DeploymentMode.class); + } + + /** + * Gets known DeploymentMode values. + * + * @return known DeploymentMode values. + */ + public static Collection values() { + return values(DeploymentMode.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSecuritySettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSecuritySettings.java new file mode 100644 index 000000000000..6980daa95a3f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSecuritySettings.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights 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 SecuritySettings of AzureStackHCI Cluster. + */ +@Fluent +public final class DeploymentSecuritySettings implements JsonSerializable { + /* + * By default, Hypervisor-protected Code Integrity is enabled on your Azure HCI cluster. + */ + private Boolean hvciProtection; + + /* + * By default, Secure Boot is enabled on your Azure HCI cluster. This setting is hardware dependent. + */ + private Boolean drtmProtection; + + /* + * When set to true, the security baseline is re-applied regularly. + */ + private Boolean driftControlEnforced; + + /* + * When set to true, Credential Guard is enabled. + */ + private Boolean credentialGuardEnforced; + + /* + * When set to true, the SMB default instance requires sign in for the client and server services. + */ + private Boolean smbSigningEnforced; + + /* + * When set to true, cluster east-west traffic is encrypted. + */ + private Boolean smbClusterEncryption; + + /* + * When set to true, all the side channel mitigations are enabled + */ + private Boolean sideChannelMitigationEnforced; + + /* + * When set to true, BitLocker XTS_AES 256-bit encryption is enabled for all data-at-rest on the OS volume of your + * Azure Stack HCI cluster. This setting is TPM-hardware dependent. + */ + private Boolean bitlockerBootVolume; + + /* + * When set to true, BitLocker XTS-AES 256-bit encryption is enabled for all data-at-rest on your Azure Stack HCI + * cluster shared volumes. + */ + private Boolean bitlockerDataVolumes; + + /* + * WDAC is enabled by default and limits the applications and the code that you can run on your Azure Stack HCI + * cluster. + */ + private Boolean wdacEnforced; + + /** + * Creates an instance of DeploymentSecuritySettings class. + */ + public DeploymentSecuritySettings() { + } + + /** + * Get the hvciProtection property: By default, Hypervisor-protected Code Integrity is enabled on your Azure HCI + * cluster. + * + * @return the hvciProtection value. + */ + public Boolean hvciProtection() { + return this.hvciProtection; + } + + /** + * Set the hvciProtection property: By default, Hypervisor-protected Code Integrity is enabled on your Azure HCI + * cluster. + * + * @param hvciProtection the hvciProtection value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withHvciProtection(Boolean hvciProtection) { + this.hvciProtection = hvciProtection; + return this; + } + + /** + * Get the drtmProtection property: By default, Secure Boot is enabled on your Azure HCI cluster. This setting is + * hardware dependent. + * + * @return the drtmProtection value. + */ + public Boolean drtmProtection() { + return this.drtmProtection; + } + + /** + * Set the drtmProtection property: By default, Secure Boot is enabled on your Azure HCI cluster. This setting is + * hardware dependent. + * + * @param drtmProtection the drtmProtection value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withDrtmProtection(Boolean drtmProtection) { + this.drtmProtection = drtmProtection; + return this; + } + + /** + * Get the driftControlEnforced property: When set to true, the security baseline is re-applied regularly. + * + * @return the driftControlEnforced value. + */ + public Boolean driftControlEnforced() { + return this.driftControlEnforced; + } + + /** + * Set the driftControlEnforced property: When set to true, the security baseline is re-applied regularly. + * + * @param driftControlEnforced the driftControlEnforced value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withDriftControlEnforced(Boolean driftControlEnforced) { + this.driftControlEnforced = driftControlEnforced; + return this; + } + + /** + * Get the credentialGuardEnforced property: When set to true, Credential Guard is enabled. + * + * @return the credentialGuardEnforced value. + */ + public Boolean credentialGuardEnforced() { + return this.credentialGuardEnforced; + } + + /** + * Set the credentialGuardEnforced property: When set to true, Credential Guard is enabled. + * + * @param credentialGuardEnforced the credentialGuardEnforced value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withCredentialGuardEnforced(Boolean credentialGuardEnforced) { + this.credentialGuardEnforced = credentialGuardEnforced; + return this; + } + + /** + * Get the smbSigningEnforced property: When set to true, the SMB default instance requires sign in for the client + * and server services. + * + * @return the smbSigningEnforced value. + */ + public Boolean smbSigningEnforced() { + return this.smbSigningEnforced; + } + + /** + * Set the smbSigningEnforced property: When set to true, the SMB default instance requires sign in for the client + * and server services. + * + * @param smbSigningEnforced the smbSigningEnforced value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withSmbSigningEnforced(Boolean smbSigningEnforced) { + this.smbSigningEnforced = smbSigningEnforced; + return this; + } + + /** + * Get the smbClusterEncryption property: When set to true, cluster east-west traffic is encrypted. + * + * @return the smbClusterEncryption value. + */ + public Boolean smbClusterEncryption() { + return this.smbClusterEncryption; + } + + /** + * Set the smbClusterEncryption property: When set to true, cluster east-west traffic is encrypted. + * + * @param smbClusterEncryption the smbClusterEncryption value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withSmbClusterEncryption(Boolean smbClusterEncryption) { + this.smbClusterEncryption = smbClusterEncryption; + return this; + } + + /** + * Get the sideChannelMitigationEnforced property: When set to true, all the side channel mitigations are enabled. + * + * @return the sideChannelMitigationEnforced value. + */ + public Boolean sideChannelMitigationEnforced() { + return this.sideChannelMitigationEnforced; + } + + /** + * Set the sideChannelMitigationEnforced property: When set to true, all the side channel mitigations are enabled. + * + * @param sideChannelMitigationEnforced the sideChannelMitigationEnforced value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withSideChannelMitigationEnforced(Boolean sideChannelMitigationEnforced) { + this.sideChannelMitigationEnforced = sideChannelMitigationEnforced; + return this; + } + + /** + * Get the bitlockerBootVolume property: When set to true, BitLocker XTS_AES 256-bit encryption is enabled for all + * data-at-rest on the OS volume of your Azure Stack HCI cluster. This setting is TPM-hardware dependent. + * + * @return the bitlockerBootVolume value. + */ + public Boolean bitlockerBootVolume() { + return this.bitlockerBootVolume; + } + + /** + * Set the bitlockerBootVolume property: When set to true, BitLocker XTS_AES 256-bit encryption is enabled for all + * data-at-rest on the OS volume of your Azure Stack HCI cluster. This setting is TPM-hardware dependent. + * + * @param bitlockerBootVolume the bitlockerBootVolume value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withBitlockerBootVolume(Boolean bitlockerBootVolume) { + this.bitlockerBootVolume = bitlockerBootVolume; + return this; + } + + /** + * Get the bitlockerDataVolumes property: When set to true, BitLocker XTS-AES 256-bit encryption is enabled for all + * data-at-rest on your Azure Stack HCI cluster shared volumes. + * + * @return the bitlockerDataVolumes value. + */ + public Boolean bitlockerDataVolumes() { + return this.bitlockerDataVolumes; + } + + /** + * Set the bitlockerDataVolumes property: When set to true, BitLocker XTS-AES 256-bit encryption is enabled for all + * data-at-rest on your Azure Stack HCI cluster shared volumes. + * + * @param bitlockerDataVolumes the bitlockerDataVolumes value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withBitlockerDataVolumes(Boolean bitlockerDataVolumes) { + this.bitlockerDataVolumes = bitlockerDataVolumes; + return this; + } + + /** + * Get the wdacEnforced property: WDAC is enabled by default and limits the applications and the code that you can + * run on your Azure Stack HCI cluster. + * + * @return the wdacEnforced value. + */ + public Boolean wdacEnforced() { + return this.wdacEnforced; + } + + /** + * Set the wdacEnforced property: WDAC is enabled by default and limits the applications and the code that you can + * run on your Azure Stack HCI cluster. + * + * @param wdacEnforced the wdacEnforced value to set. + * @return the DeploymentSecuritySettings object itself. + */ + public DeploymentSecuritySettings withWdacEnforced(Boolean wdacEnforced) { + this.wdacEnforced = wdacEnforced; + 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("hvciProtection", this.hvciProtection); + jsonWriter.writeBooleanField("drtmProtection", this.drtmProtection); + jsonWriter.writeBooleanField("driftControlEnforced", this.driftControlEnforced); + jsonWriter.writeBooleanField("credentialGuardEnforced", this.credentialGuardEnforced); + jsonWriter.writeBooleanField("smbSigningEnforced", this.smbSigningEnforced); + jsonWriter.writeBooleanField("smbClusterEncryption", this.smbClusterEncryption); + jsonWriter.writeBooleanField("sideChannelMitigationEnforced", this.sideChannelMitigationEnforced); + jsonWriter.writeBooleanField("bitlockerBootVolume", this.bitlockerBootVolume); + jsonWriter.writeBooleanField("bitlockerDataVolumes", this.bitlockerDataVolumes); + jsonWriter.writeBooleanField("wdacEnforced", this.wdacEnforced); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentSecuritySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentSecuritySettings 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 DeploymentSecuritySettings. + */ + public static DeploymentSecuritySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentSecuritySettings deserializedDeploymentSecuritySettings = new DeploymentSecuritySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hvciProtection".equals(fieldName)) { + deserializedDeploymentSecuritySettings.hvciProtection = reader.getNullable(JsonReader::getBoolean); + } else if ("drtmProtection".equals(fieldName)) { + deserializedDeploymentSecuritySettings.drtmProtection = reader.getNullable(JsonReader::getBoolean); + } else if ("driftControlEnforced".equals(fieldName)) { + deserializedDeploymentSecuritySettings.driftControlEnforced + = reader.getNullable(JsonReader::getBoolean); + } else if ("credentialGuardEnforced".equals(fieldName)) { + deserializedDeploymentSecuritySettings.credentialGuardEnforced + = reader.getNullable(JsonReader::getBoolean); + } else if ("smbSigningEnforced".equals(fieldName)) { + deserializedDeploymentSecuritySettings.smbSigningEnforced + = reader.getNullable(JsonReader::getBoolean); + } else if ("smbClusterEncryption".equals(fieldName)) { + deserializedDeploymentSecuritySettings.smbClusterEncryption + = reader.getNullable(JsonReader::getBoolean); + } else if ("sideChannelMitigationEnforced".equals(fieldName)) { + deserializedDeploymentSecuritySettings.sideChannelMitigationEnforced + = reader.getNullable(JsonReader::getBoolean); + } else if ("bitlockerBootVolume".equals(fieldName)) { + deserializedDeploymentSecuritySettings.bitlockerBootVolume + = reader.getNullable(JsonReader::getBoolean); + } else if ("bitlockerDataVolumes".equals(fieldName)) { + deserializedDeploymentSecuritySettings.bitlockerDataVolumes + = reader.getNullable(JsonReader::getBoolean); + } else if ("wdacEnforced".equals(fieldName)) { + deserializedDeploymentSecuritySettings.wdacEnforced = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentSecuritySettings; + }); + } +} 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 new file mode 100644 index 000000000000..1d79e36374ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSetting.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingInner; +import java.util.List; + +/** + * An immutable client-side representation of DeploymentSetting. + */ +public interface DeploymentSetting { + /** + * 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 provisioningState property: DeploymentSetting provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster. + * + * @return the arcNodeResourceIds value. + */ + List arcNodeResourceIds(); + + /** + * Gets the deploymentMode property: The deployment mode for cluster deployment. + * + * @return the deploymentMode value. + */ + DeploymentMode deploymentMode(); + + /** + * Gets the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @return the deploymentConfiguration value. + */ + DeploymentConfiguration deploymentConfiguration(); + + /** + * Gets the reportedProperties property: Deployment Status reported from cluster. + * + * @return the reportedProperties value. + */ + ReportedProperties reportedProperties(); + + /** + * 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.DeploymentSettingInner object. + * + * @return the inner object. + */ + DeploymentSettingInner innerModel(); + + /** + * The entirety of the DeploymentSetting definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DeploymentSetting definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DeploymentSetting definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DeploymentSetting definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the 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.WithProvisioningState, DefinitionStages.WithArcNodeResourceIds, + DefinitionStages.WithDeploymentMode, DefinitionStages.WithDeploymentConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + DeploymentSetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + 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. + */ + interface WithArcNodeResourceIds { + /** + * Specifies the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster.. + * + * @param arcNodeResourceIds Azure resource ids of Arc machines to be part of cluster. + * @return the next definition stage. + */ + WithCreate withArcNodeResourceIds(List arcNodeResourceIds); + } + + /** + * The stage of the DeploymentSetting definition allowing to specify deploymentMode. + */ + interface WithDeploymentMode { + /** + * Specifies the deploymentMode property: The deployment mode for cluster deployment.. + * + * @param deploymentMode The deployment mode for cluster deployment. + * @return the next definition stage. + */ + WithCreate withDeploymentMode(DeploymentMode deploymentMode); + } + + /** + * The stage of the DeploymentSetting definition allowing to specify deploymentConfiguration. + */ + interface WithDeploymentConfiguration { + /** + * Specifies the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @param deploymentConfiguration Scale units will contains list of deployment data. + * @return the next definition stage. + */ + WithCreate withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration); + } + } + + /** + * Begins update for the DeploymentSetting resource. + * + * @return the stage of resource update. + */ + DeploymentSetting.Update update(); + + /** + * The template for DeploymentSetting update. + */ + interface Update extends UpdateStages.WithProvisioningState, UpdateStages.WithArcNodeResourceIds, + UpdateStages.WithDeploymentMode, UpdateStages.WithDeploymentConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DeploymentSetting apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DeploymentSetting apply(Context context); + } + + /** + * 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. + */ + interface WithArcNodeResourceIds { + /** + * Specifies the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster.. + * + * @param arcNodeResourceIds Azure resource ids of Arc machines to be part of cluster. + * @return the next definition stage. + */ + Update withArcNodeResourceIds(List arcNodeResourceIds); + } + + /** + * The stage of the DeploymentSetting update allowing to specify deploymentMode. + */ + interface WithDeploymentMode { + /** + * Specifies the deploymentMode property: The deployment mode for cluster deployment.. + * + * @param deploymentMode The deployment mode for cluster deployment. + * @return the next definition stage. + */ + Update withDeploymentMode(DeploymentMode deploymentMode); + } + + /** + * The stage of the DeploymentSetting update allowing to specify deploymentConfiguration. + */ + interface WithDeploymentConfiguration { + /** + * Specifies the deploymentConfiguration property: Scale units will contains list of deployment data. + * + * @param deploymentConfiguration Scale units will contains list of deployment data. + * @return the next definition stage. + */ + Update withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DeploymentSetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DeploymentSetting refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingListResult.java new file mode 100644 index 000000000000..5d87c81bbd5e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettingListResult.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.DeploymentSettingInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DeploymentSetting list operation. + */ +@Fluent +public final class DeploymentSettingListResult implements JsonSerializable { + /* + * The DeploymentSetting items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DeploymentSettingListResult class. + */ + public DeploymentSettingListResult() { + } + + /** + * Get the value property: The DeploymentSetting items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DeploymentSetting items on this page. + * + * @param value the value value to set. + * @return the DeploymentSettingListResult object itself. + */ + public DeploymentSettingListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DeploymentSettingListResult object itself. + */ + public DeploymentSettingListResult 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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DeploymentSettingListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentSettingListResult.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 DeploymentSettingListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentSettingListResult 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 DeploymentSettingListResult. + */ + public static DeploymentSettingListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentSettingListResult deserializedDeploymentSettingListResult = new DeploymentSettingListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeploymentSettingInner.fromJson(reader1)); + deserializedDeploymentSettingListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeploymentSettingListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentSettingListResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettings.java new file mode 100644 index 000000000000..9d1728609363 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentSettings.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DeploymentSettings. + */ +public interface DeploymentSettings { + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusters(String resourceGroupName, String clusterName); + + /** + * List DeploymentSetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentSetting list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DeploymentSetting along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, + String deploymentSettingsName, Context context); + + /** + * Get a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DeploymentSetting. + */ + DeploymentSetting get(String resourceGroupName, String clusterName, String deploymentSettingsName); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String deploymentSettingsName); + + /** + * Delete a DeploymentSetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param deploymentSettingsName Name of Deployment Setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String deploymentSettingsName, Context context); + + /** + * Get a DeploymentSetting. + * + * @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 DeploymentSetting along with {@link Response}. + */ + DeploymentSetting getById(String id); + + /** + * Get a DeploymentSetting. + * + * @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 DeploymentSetting along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a DeploymentSetting. + * + * @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 DeploymentSetting. + * + * @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 DeploymentSetting resource. + * + * @param name resource name. + * @return the first stage of the new DeploymentSetting definition. + */ + DeploymentSetting.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.java new file mode 100644 index 000000000000..ff99baae4b9e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStatus.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 DeploymentStatus of AzureStackHCI Cluster. + */ +@Immutable +public final class DeploymentStatus implements JsonSerializable { + /* + * Status of AzureStackHCI Cluster Deployment. + */ + private String status; + + /* + * List of steps of AzureStackHCI Cluster Deployment. + */ + private List steps; + + /** + * Creates an instance of DeploymentStatus class. + */ + public DeploymentStatus() { + } + + /** + * 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 DeploymentStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 DeploymentStatus. + */ + public static DeploymentStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentStatus deserializedDeploymentStatus = new DeploymentStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedDeploymentStatus.status = reader.getString(); + } else if ("steps".equals(fieldName)) { + List steps = reader.readArray(reader1 -> DeploymentStep.fromJson(reader1)); + deserializedDeploymentStatus.steps = steps; + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentStatus; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStep.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStep.java new file mode 100644 index 000000000000..974bc57fe0f4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeploymentStep.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.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 Step of AzureStackHCI Cluster. + */ +@Immutable +public final class DeploymentStep implements JsonSerializable { + /* + * Name of step. + */ + private String name; + + /* + * Description of step. + */ + private String description; + + /* + * FullStepIndex of step. + */ + private String fullStepIndex; + + /* + * Start time of step. + */ + private String startTimeUtc; + + /* + * End time of step. + */ + private String endTimeUtc; + + /* + * Status of step. Allowed values are 'Error', 'Success', 'InProgress' + */ + private String status; + + /* + * List of nested steps of AzureStackHCI Cluster Deployment. + */ + private List steps; + + /* + * List of exceptions in AzureStackHCI Cluster Deployment. + */ + private List exception; + + /** + * Creates an instance of DeploymentStep class. + */ + public DeploymentStep() { + } + + /** + * Get the name property: Name of step. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the description property: Description of step. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the fullStepIndex property: FullStepIndex of step. + * + * @return the fullStepIndex value. + */ + public String fullStepIndex() { + return this.fullStepIndex; + } + + /** + * Get the startTimeUtc property: Start time of step. + * + * @return the startTimeUtc value. + */ + public String startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the endTimeUtc property: End time of step. + * + * @return the endTimeUtc value. + */ + public String endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the status property: Status of step. Allowed values are 'Error', 'Success', 'InProgress'. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the steps property: List of nested steps of AzureStackHCI Cluster Deployment. + * + * @return the steps value. + */ + public List steps() { + return this.steps; + } + + /** + * Get the exception property: List of exceptions in AzureStackHCI Cluster Deployment. + * + * @return the exception value. + */ + public List exception() { + return this.exception; + } + + /** + * 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 DeploymentStep from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentStep 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 DeploymentStep. + */ + public static DeploymentStep fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentStep deserializedDeploymentStep = new DeploymentStep(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeploymentStep.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDeploymentStep.description = reader.getString(); + } else if ("fullStepIndex".equals(fieldName)) { + deserializedDeploymentStep.fullStepIndex = reader.getString(); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedDeploymentStep.startTimeUtc = reader.getString(); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedDeploymentStep.endTimeUtc = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDeploymentStep.status = reader.getString(); + } else if ("steps".equals(fieldName)) { + List steps = reader.readArray(reader1 -> DeploymentStep.fromJson(reader1)); + deserializedDeploymentStep.steps = steps; + } else if ("exception".equals(fieldName)) { + List exception = reader.readArray(reader1 -> reader1.getString()); + deserializedDeploymentStep.exception = exception; + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentStep; + }); + } +} 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 new file mode 100644 index 000000000000..416cbb33b522 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DeviceConfiguration.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; +import java.util.List; + +/** + * The device Configuration of a device. + */ +@Fluent +public final class DeviceConfiguration implements JsonSerializable { + /* + * NIC Details of device + */ + private List nicDetails; + + /* + * device metadata details. + */ + private String deviceMetadata; + + /** + * Creates an instance of DeviceConfiguration class. + */ + public DeviceConfiguration() { + } + + /** + * Get the nicDetails property: NIC Details of device. + * + * @return the nicDetails value. + */ + public List nicDetails() { + return this.nicDetails; + } + + /** + * Set the nicDetails property: NIC Details of device. + * + * @param nicDetails the nicDetails value to set. + * @return the DeviceConfiguration object itself. + */ + public DeviceConfiguration withNicDetails(List nicDetails) { + this.nicDetails = nicDetails; + return this; + } + + /** + * Get the deviceMetadata property: device metadata details. + * + * @return the deviceMetadata value. + */ + public String deviceMetadata() { + return this.deviceMetadata; + } + + /** + * Set the deviceMetadata property: device metadata details. + * + * @param deviceMetadata the deviceMetadata value to set. + * @return the DeviceConfiguration object itself. + */ + public DeviceConfiguration withDeviceMetadata(String deviceMetadata) { + this.deviceMetadata = deviceMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nicDetails() != null) { + nicDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nicDetails", this.nicDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("deviceMetadata", this.deviceMetadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceConfiguration 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 DeviceConfiguration. + */ + public static DeviceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceConfiguration deserializedDeviceConfiguration = new DeviceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nicDetails".equals(fieldName)) { + List nicDetails = reader.readArray(reader1 -> NicDetail.fromJson(reader1)); + deserializedDeviceConfiguration.nicDetails = nicDetails; + } else if ("deviceMetadata".equals(fieldName)) { + deserializedDeviceConfiguration.deviceMetadata = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceConfiguration; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java new file mode 100644 index 000000000000..732cf139f997 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.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; + +/** + * Desired level of diagnostic data emitted by the cluster. + */ +public final class DiagnosticLevel extends ExpandableStringEnum { + /** + * Static value Off for DiagnosticLevel. + */ + public static final DiagnosticLevel OFF = fromString("Off"); + + /** + * Static value Basic for DiagnosticLevel. + */ + public static final DiagnosticLevel BASIC = fromString("Basic"); + + /** + * Static value Enhanced for DiagnosticLevel. + */ + public static final DiagnosticLevel ENHANCED = fromString("Enhanced"); + + /** + * Creates a new instance of DiagnosticLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiagnosticLevel() { + } + + /** + * Creates or finds a DiagnosticLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiagnosticLevel. + */ + public static DiagnosticLevel fromString(String name) { + return fromString(name, DiagnosticLevel.class); + } + + /** + * Gets known DiagnosticLevel values. + * + * @return known DiagnosticLevel values. + */ + public static Collection values() { + return values(DiagnosticLevel.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiskFileFormat.java index a364631c4edd..508dd6f0fabd 100644 --- 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 @@ -5,20 +5,25 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The format of the actual VHD file [vhd, vhdx]. */ +/** + * The format of the actual VHD file [vhd, vhdx]. + */ public final class DiskFileFormat extends ExpandableStringEnum { - /** Static value vhdx for DiskFileFormat. */ + /** + * Static value vhdx for DiskFileFormat. + */ public static final DiskFileFormat VHDX = fromString("vhdx"); - /** Static value vhd for DiskFileFormat. */ + /** + * 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 @@ -27,18 +32,17 @@ public DiskFileFormat() { /** * Creates or finds a DiskFileFormat from its string representation. - * + * * @param name a name to look for. * @return the corresponding DiskFileFormat. */ - @JsonCreator public static DiskFileFormat fromString(String name) { return fromString(name, DiskFileFormat.class); } /** * Gets known DiskFileFormat values. - * + * * @return known DiskFileFormat values. */ public static Collection values() { 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 new file mode 100644 index 000000000000..27a74b998f71 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevice.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.EdgeDeviceInner; + +/** + * An immutable client-side representation of EdgeDevice. + */ +public interface EdgeDevice { + /** + * 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 deviceConfiguration property: Device Configuration. + * + * @return the deviceConfiguration value. + */ + 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. + * + * @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/EdgeDeviceListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDeviceListResult.java new file mode 100644 index 000000000000..891a38963da4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDeviceListResult.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.EdgeDeviceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EdgeDevice list operation. + */ +@Fluent +public final class EdgeDeviceListResult implements JsonSerializable { + /* + * The EdgeDevice items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EdgeDeviceListResult class. + */ + public EdgeDeviceListResult() { + } + + /** + * Get the value property: The EdgeDevice items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EdgeDevice items on this page. + * + * @param value the value value to set. + * @return the EdgeDeviceListResult object itself. + */ + public EdgeDeviceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EdgeDeviceListResult object itself. + */ + public EdgeDeviceListResult 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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EdgeDeviceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EdgeDeviceListResult.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 EdgeDeviceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeDeviceListResult 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 EdgeDeviceListResult. + */ + public static EdgeDeviceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeDeviceListResult deserializedEdgeDeviceListResult = new EdgeDeviceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EdgeDeviceInner.fromJson(reader1)); + deserializedEdgeDeviceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEdgeDeviceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeDeviceListResult; + }); + } +} 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 new file mode 100644 index 000000000000..5b26372b729e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/EdgeDevices.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EdgeDevices. + */ +public interface EdgeDevices { + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * List EdgeDevice resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a EdgeDevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 EdgeDevice along with {@link Response}. + */ + Response getWithResponse(String resourceUri, String edgeDeviceName, Context context); + + /** + * Get a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 EdgeDevice. + */ + EdgeDevice get(String resourceUri, String edgeDeviceName); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri, String edgeDeviceName); + + /** + * Delete a EdgeDevice. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param edgeDeviceName Name of Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String edgeDeviceName, Context context); + + /** + * 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. + */ + ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest); + + /** + * 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. + */ + ValidateResponse validate(String resourceUri, String edgeDeviceName, ValidateRequest validateRequest, + Context context); + + /** + * Get 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. + * @return a EdgeDevice along with {@link Response}. + */ + EdgeDevice getById(String id); + + /** + * Get 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. + * @return a EdgeDevice along with {@link Response}. + */ + 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/ExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java index 89b453378f13..c4d2efd77910 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtendedLocation.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 complex type of the extended location. */ +/** + * The complex type of the extended location. + */ @Fluent -public final class ExtendedLocation { +public final class ExtendedLocation implements JsonSerializable { /* * The name of the extended location. */ - @JsonProperty(value = "name") private String name; /* * The type of the extended location. */ - @JsonProperty(value = "type") private ExtendedLocationTypes type; - /** Creates an instance of ExtendedLocation class. */ + /** + * Creates an instance of ExtendedLocation class. + */ public ExtendedLocation() { } /** * Get the name property: The name of the extended location. - * + * * @return the name value. */ public String name() { @@ -37,7 +43,7 @@ public String name() { /** * Set the name property: The name of the extended location. - * + * * @param name the name value to set. * @return the ExtendedLocation object itself. */ @@ -48,7 +54,7 @@ public ExtendedLocation withName(String name) { /** * Get the type property: The type of the extended location. - * + * * @return the type value. */ public ExtendedLocationTypes type() { @@ -57,7 +63,7 @@ public ExtendedLocationTypes type() { /** * Set the type property: The type of the extended location. - * + * * @param type the type value to set. * @return the ExtendedLocation object itself. */ @@ -68,9 +74,48 @@ public ExtendedLocation withType(ExtendedLocationTypes type) { /** * 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("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + 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 index acbaaa66f71a..bafff18ac4ed 100644 --- 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 @@ -5,17 +5,20 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of extendedLocation. */ +/** + * The type of extendedLocation. + */ public final class ExtendedLocationTypes extends ExpandableStringEnum { - /** Static value CustomLocation for ExtendedLocationTypes. */ + /** + * 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 @@ -24,18 +27,17 @@ public ExtendedLocationTypes() { /** * Creates or finds a ExtendedLocationTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExtendedLocationTypes. */ - @JsonCreator public static ExtendedLocationTypes fromString(String name) { return fromString(name, ExtendedLocationTypes.class); } /** * Gets known ExtendedLocationTypes values. - * + * * @return known ExtendedLocationTypes values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java new file mode 100644 index 000000000000..f119781d3f1d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import java.util.List; + +/** + * An immutable client-side representation of Extension. + */ +public interface Extension { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + ExtensionAggregateState aggregateState(); + + /** + * Gets the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + List perNodeExtensionDetails(); + + /** + * Gets the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + ExtensionManagedBy managedBy(); + + /** + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used + * if not specified. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Object settings(); + + /** + * Gets the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner object. + * + * @return the inner object. + */ + ExtensionInner innerModel(); + + /** + * The entirety of the Extension definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Extension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Extension definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Extension definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, arcSettingName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @return the next definition stage. + */ + WithCreate withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + } + + /** + * The stage of the Extension definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithForceUpdateTag, DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, DefinitionStages.WithEnableAutomaticUpgrade { + /** + * Executes the create request. + * + * @return the created resource. + */ + Extension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Extension create(Context context); + } + + /** + * The stage of the Extension definition allowing to specify forceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the Extension definition allowing to specify publisher. + */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the Extension definition allowing to specify typePropertiesType. + */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + + /** + * The stage of the Extension definition allowing to specify typeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler. Latest version + * would be used if not specified.. + * + * @param typeHandlerVersion Specifies the version of the script handler. Latest version would be used if + * not specified. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + + /** + * The stage of the Extension definition allowing to specify autoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the Extension definition allowing to specify settings. + */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Object settings); + } + + /** + * The stage of the Extension definition allowing to specify protectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: Protected settings (may contain secrets).. + * + * @param protectedSettings Protected settings (may contain secrets). + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the Extension definition allowing to specify enableAutomaticUpgrade. + */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + } + + /** + * Begins update for the Extension resource. + * + * @return the stage of resource update. + */ + Extension.Update update(); + + /** + * The template for Extension update. + */ + interface Update extends UpdateStages.WithExtensionParameters { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Extension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Extension apply(Context context); + } + + /** + * The Extension update stages. + */ + interface UpdateStages { + /** + * The stage of the Extension update allowing to specify extensionParameters. + */ + interface WithExtensionParameters { + /** + * Specifies the extensionParameters property: Describes the properties of a Machine Extension that can be + * updated.. + * + * @param extensionParameters Describes the properties of a Machine Extension that can be updated. + * @return the next definition stage. + */ + Update withExtensionParameters(ExtensionPatchParameters extensionParameters); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Extension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Extension refresh(Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters, Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java new file mode 100644 index 000000000000..93c6cefe6ec2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Aggregate state of Arc Extensions across the nodes in this HCI cluster. + */ +public final class ExtensionAggregateState extends ExpandableStringEnum { + /** + * Static value NotSpecified for ExtensionAggregateState. + */ + public static final ExtensionAggregateState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Error for ExtensionAggregateState. + */ + public static final ExtensionAggregateState ERROR = fromString("Error"); + + /** + * Static value Succeeded for ExtensionAggregateState. + */ + public static final ExtensionAggregateState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for ExtensionAggregateState. + */ + public static final ExtensionAggregateState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for ExtensionAggregateState. + */ + public static final ExtensionAggregateState FAILED = fromString("Failed"); + + /** + * Static value Connected for ExtensionAggregateState. + */ + public static final ExtensionAggregateState CONNECTED = fromString("Connected"); + + /** + * Static value Disconnected for ExtensionAggregateState. + */ + public static final ExtensionAggregateState DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Deleted for ExtensionAggregateState. + */ + public static final ExtensionAggregateState DELETED = fromString("Deleted"); + + /** + * Static value Creating for ExtensionAggregateState. + */ + public static final ExtensionAggregateState CREATING = fromString("Creating"); + + /** + * Static value Updating for ExtensionAggregateState. + */ + public static final ExtensionAggregateState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ExtensionAggregateState. + */ + public static final ExtensionAggregateState DELETING = fromString("Deleting"); + + /** + * Static value Moving for ExtensionAggregateState. + */ + public static final ExtensionAggregateState MOVING = fromString("Moving"); + + /** + * Static value PartiallySucceeded for ExtensionAggregateState. + */ + public static final ExtensionAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** + * Static value PartiallyConnected for ExtensionAggregateState. + */ + public static final ExtensionAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value InProgress for ExtensionAggregateState. + */ + public static final ExtensionAggregateState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Accepted for ExtensionAggregateState. + */ + public static final ExtensionAggregateState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for ExtensionAggregateState. + */ + public static final ExtensionAggregateState PROVISIONING = fromString("Provisioning"); + + /** + * Static value UpgradeFailedRollbackSucceeded for ExtensionAggregateState. + */ + public static final ExtensionAggregateState UPGRADE_FAILED_ROLLBACK_SUCCEEDED + = fromString("UpgradeFailedRollbackSucceeded"); + + /** + * Creates a new instance of ExtensionAggregateState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtensionAggregateState() { + } + + /** + * Creates or finds a ExtensionAggregateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionAggregateState. + */ + public static ExtensionAggregateState fromString(String name) { + return fromString(name, ExtensionAggregateState.class); + } + + /** + * Gets known ExtensionAggregateState values. + * + * @return known ExtensionAggregateState values. + */ + public static Collection values() { + return values(ExtensionAggregateState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceView.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceView.java new file mode 100644 index 000000000000..f0c46efa3b94 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceView.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * Describes the Extension Instance View. + */ +@Fluent +public final class ExtensionInstanceView implements JsonSerializable { + /* + * The extension name. + */ + private String name; + + /* + * Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". + */ + private String type; + + /* + * Specifies the version of the script handler. + */ + private String typeHandlerVersion; + + /* + * Instance view status. + */ + private ExtensionInstanceViewStatus status; + + /** + * Creates an instance of ExtensionInstanceView class. + */ + public ExtensionInstanceView() { + } + + /** + * Get the name property: The extension name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extension name. + * + * @param name the name value to set. + * @return the ExtensionInstanceView object itself. + */ + public ExtensionInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". + * + * @param type the type value to set. + * @return the ExtensionInstanceView object itself. + */ + public ExtensionInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionInstanceView object itself. + */ + public ExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the status property: Instance view status. + * + * @return the status value. + */ + public ExtensionInstanceViewStatus status() { + return this.status; + } + + /** + * Set the status property: Instance view status. + * + * @param status the status value to set. + * @return the ExtensionInstanceView object itself. + */ + public ExtensionInstanceView withStatus(ExtensionInstanceViewStatus status) { + this.status = status; + return this; + } + + /** + * 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.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("typeHandlerVersion", this.typeHandlerVersion); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionInstanceView 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 ExtensionInstanceView. + */ + public static ExtensionInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionInstanceView deserializedExtensionInstanceView = new ExtensionInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtensionInstanceView.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtensionInstanceView.type = reader.getString(); + } else if ("typeHandlerVersion".equals(fieldName)) { + deserializedExtensionInstanceView.typeHandlerVersion = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedExtensionInstanceView.status = ExtensionInstanceViewStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionInstanceView; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceViewStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceViewStatus.java new file mode 100644 index 000000000000..075eb318125d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceViewStatus.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 ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus class. + */ + public ExtensionInstanceViewStatus() { + } + + /** + * 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 ExtensionInstanceViewStatus object itself. + */ + public ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus object itself. + */ + public ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus object itself. + */ + public ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus object itself. + */ + public ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus object itself. + */ + public ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionInstanceViewStatus 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 ExtensionInstanceViewStatus. + */ + public static ExtensionInstanceViewStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionInstanceViewStatus deserializedExtensionInstanceViewStatus = new ExtensionInstanceViewStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedExtensionInstanceViewStatus.code = reader.getString(); + } else if ("level".equals(fieldName)) { + deserializedExtensionInstanceViewStatus.level = StatusLevelTypes.fromString(reader.getString()); + } else if ("displayStatus".equals(fieldName)) { + deserializedExtensionInstanceViewStatus.displayStatus = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedExtensionInstanceViewStatus.message = reader.getString(); + } else if ("time".equals(fieldName)) { + deserializedExtensionInstanceViewStatus.time = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionInstanceViewStatus; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java new file mode 100644 index 000000000000..262dca176b1d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.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.Immutable; +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.ExtensionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Extensions in HCI cluster. + */ +@Immutable +public final class ExtensionList implements JsonSerializable { + /* + * List of Extensions in HCI cluster. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExtensionList class. + */ + public ExtensionList() { + } + + /** + * Get the value property: List of Extensions in HCI cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionList 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 ExtensionList. + */ + public static ExtensionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionList deserializedExtensionList = new ExtensionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ExtensionInner.fromJson(reader1)); + deserializedExtensionList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExtensionList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionList; + }); + } +} 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 new file mode 100644 index 000000000000..31f40d1273df --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionManagedBy.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; + +/** + * Indicates if the extension is managed by azure or the user. + */ +public final class ExtensionManagedBy extends ExpandableStringEnum { + /** + * Static value Azure for ExtensionManagedBy. + */ + public static final ExtensionManagedBy AZURE = fromString("Azure"); + + /** + * Static value User for ExtensionManagedBy. + */ + public static final ExtensionManagedBy USER = fromString("User"); + + /** + * Creates a new instance of ExtensionManagedBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtensionManagedBy() { + } + + /** + * Creates or finds a ExtensionManagedBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionManagedBy. + */ + public static ExtensionManagedBy fromString(String name) { + return fromString(name, ExtensionManagedBy.class); + } + + /** + * Gets known ExtensionManagedBy values. + * + * @return known ExtensionManagedBy values. + */ + public static Collection values() { + return values(ExtensionManagedBy.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java new file mode 100644 index 000000000000..969c7b634d97 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.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.ExtensionPatchProperties; +import java.io.IOException; + +/** + * Extension Details to update. + */ +@Fluent +public final class ExtensionPatch implements JsonSerializable { + /* + * Describes Machine Extension Properties that can be updated. + */ + private ExtensionPatchProperties innerProperties; + + /** + * Creates an instance of ExtensionPatch class. + */ + public ExtensionPatch() { + } + + /** + * Get the innerProperties property: Describes Machine Extension Properties that can be updated. + * + * @return the innerProperties value. + */ + private ExtensionPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @return the extensionParameters value. + */ + public ExtensionPatchParameters extensionParameters() { + return this.innerProperties() == null ? null : this.innerProperties().extensionParameters(); + } + + /** + * Set the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @param extensionParameters the extensionParameters value to set. + * @return the ExtensionPatch object itself. + */ + public ExtensionPatch withExtensionParameters(ExtensionPatchParameters extensionParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionPatchProperties(); + } + this.innerProperties().withExtensionParameters(extensionParameters); + 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 ExtensionPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionPatch 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 ExtensionPatch. + */ + public static ExtensionPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionPatch deserializedExtensionPatch = new ExtensionPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedExtensionPatch.innerProperties = ExtensionPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionPatch; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java new file mode 100644 index 000000000000..5dd7da164a1e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * Describes the properties of a Machine Extension that can be updated. + */ +@Fluent +public final class ExtensionPatchParameters implements JsonSerializable { + /* + * Specifies the version of the script handler. Latest version would be used if not specified. + */ + private String typeHandlerVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + private Object settings; + + /* + * Protected settings (may contain secrets). + */ + private Object protectedSettings; + + /** + * Creates an instance of ExtensionPatchParameters class. + */ + public ExtensionPatchParameters() { + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + 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("typeHandlerVersion", this.typeHandlerVersion); + jsonWriter.writeBooleanField("enableAutomaticUpgrade", this.enableAutomaticUpgrade); + jsonWriter.writeUntypedField("settings", this.settings); + jsonWriter.writeUntypedField("protectedSettings", this.protectedSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionPatchParameters 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 ExtensionPatchParameters. + */ + public static ExtensionPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionPatchParameters deserializedExtensionPatchParameters = new ExtensionPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeHandlerVersion".equals(fieldName)) { + deserializedExtensionPatchParameters.typeHandlerVersion = reader.getString(); + } else if ("enableAutomaticUpgrade".equals(fieldName)) { + deserializedExtensionPatchParameters.enableAutomaticUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("settings".equals(fieldName)) { + deserializedExtensionPatchParameters.settings = reader.readUntyped(); + } else if ("protectedSettings".equals(fieldName)) { + deserializedExtensionPatchParameters.protectedSettings = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionPatchParameters; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java new file mode 100644 index 000000000000..62a1d098a2b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * Describes the parameters for Extension upgrade. + */ +@Fluent +public final class ExtensionUpgradeParameters implements JsonSerializable { + /* + * Extension Upgrade Target Version. + */ + private String targetVersion; + + /** + * Creates an instance of ExtensionUpgradeParameters class. + */ + public ExtensionUpgradeParameters() { + } + + /** + * Get the targetVersion property: Extension Upgrade Target Version. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Set the targetVersion property: Extension Upgrade Target Version. + * + * @param targetVersion the targetVersion value to set. + * @return the ExtensionUpgradeParameters object itself. + */ + public ExtensionUpgradeParameters withTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + 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("targetVersion", this.targetVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionUpgradeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionUpgradeParameters 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 ExtensionUpgradeParameters. + */ + public static ExtensionUpgradeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionUpgradeParameters deserializedExtensionUpgradeParameters = new ExtensionUpgradeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetVersion".equals(fieldName)) { + deserializedExtensionUpgradeParameters.targetVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionUpgradeParameters; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java new file mode 100644 index 000000000000..1b682bec8ee8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights 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 Extensions. + */ +public interface Extensions { + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName, + Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String arcSettingName, + String extensionName, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(String resourceGroupName, String clusterName, String arcSettingName, String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Extension getById(String id); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Extension resource. + * + * @param name resource name. + * @return the first stage of the new Extension definition. + */ + Extension.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java index bc82ab72fb53..e46254eb42bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryDiskImage.java @@ -5,35 +5,88 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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 disk image base class. */ +/** + * This is the disk image base class. + */ @Immutable -public class GalleryDiskImage { +public class GalleryDiskImage implements JsonSerializable { /* * This property indicates the size of the VHD to be created. */ - @JsonProperty(value = "sizeInMB", access = JsonProperty.Access.WRITE_ONLY) private Long sizeInMB; - /** Creates an instance of GalleryDiskImage class. */ + /** + * Creates an instance of GalleryDiskImage class. + */ public GalleryDiskImage() { } /** * Get the sizeInMB property: This property indicates the size of the VHD to be created. - * + * * @return the sizeInMB value. */ public Long sizeInMB() { return this.sizeInMB; } + /** + * 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; + } + /** * 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 GalleryDiskImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 GalleryDiskImage. + */ + public static GalleryDiskImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryDiskImage deserializedGalleryDiskImage = new GalleryDiskImage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sizeInMB".equals(fieldName)) { + deserializedGalleryDiskImage.sizeInMB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + 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 index abe7f233e923..c52dbb22cf4d 100644 --- 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 @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * This is the gallery image definition identifier. + */ @Fluent -public final class GalleryImageIdentifier { +public final class GalleryImageIdentifier implements JsonSerializable { /* * The name of the gallery image definition publisher. */ - @JsonProperty(value = "publisher", required = true) private String publisher; /* * The name of the gallery image definition offer. */ - @JsonProperty(value = "offer", required = true) private String offer; /* * The name of the gallery image definition SKU. */ - @JsonProperty(value = "sku", required = true) private String sku; - /** Creates an instance of GalleryImageIdentifier class. */ + /** + * 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() { @@ -44,7 +49,7 @@ public String 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. */ @@ -55,7 +60,7 @@ public GalleryImageIdentifier withPublisher(String publisher) { /** * Get the offer property: The name of the gallery image definition offer. - * + * * @return the offer value. */ public String offer() { @@ -64,7 +69,7 @@ public String 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. */ @@ -75,7 +80,7 @@ public GalleryImageIdentifier withOffer(String offer) { /** * Get the sku property: The name of the gallery image definition SKU. - * + * * @return the sku value. */ public String sku() { @@ -84,7 +89,7 @@ public String 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. */ @@ -95,27 +100,67 @@ public GalleryImageIdentifier withSku(String sku) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (publisher() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model GalleryImageIdentifier")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model GalleryImageIdentifier")); } if (offer() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); } if (sku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model GalleryImageIdentifier")); + 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 index ace2b72f0b3a..9fe726573855 100644 --- 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 @@ -5,48 +5,51 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The observed state of gallery images. */ +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 { +public final class GalleryImageStatus implements JsonSerializable { /* * GalleryImage provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private GalleryImageStatusProvisioningStatus provisioningStatus; /* * The download status of the gallery image */ - @JsonProperty(value = "downloadStatus") private GalleryImageStatusDownloadStatus downloadStatus; /* * The progress of the operation in percentage */ - @JsonProperty(value = "progressPercentage") private Long progressPercentage; - /** Creates an instance of GalleryImageStatus class. */ + /** + * Creates an instance of GalleryImageStatus class. + */ public GalleryImageStatus() { } /** * Get the errorCode property: GalleryImage provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -55,7 +58,7 @@ public String errorCode() { /** * Set the errorCode property: GalleryImage provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the GalleryImageStatus object itself. */ @@ -66,7 +69,7 @@ public GalleryImageStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -75,7 +78,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the GalleryImageStatus object itself. */ @@ -86,7 +89,7 @@ public GalleryImageStatus withErrorMessage(String errorMessage) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public GalleryImageStatusProvisioningStatus provisioningStatus() { @@ -95,7 +98,7 @@ public GalleryImageStatusProvisioningStatus provisioningStatus() { /** * Set the provisioningStatus property: The provisioningStatus property. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the GalleryImageStatus object itself. */ @@ -106,7 +109,7 @@ public GalleryImageStatus withProvisioningStatus(GalleryImageStatusProvisioningS /** * Get the downloadStatus property: The download status of the gallery image. - * + * * @return the downloadStatus value. */ public GalleryImageStatusDownloadStatus downloadStatus() { @@ -115,7 +118,7 @@ public GalleryImageStatusDownloadStatus downloadStatus() { /** * Set the downloadStatus property: The download status of the gallery image. - * + * * @param downloadStatus the downloadStatus value to set. * @return the GalleryImageStatus object itself. */ @@ -126,7 +129,7 @@ public GalleryImageStatus withDownloadStatus(GalleryImageStatusDownloadStatus do /** * Get the progressPercentage property: The progress of the operation in percentage. - * + * * @return the progressPercentage value. */ public Long progressPercentage() { @@ -135,7 +138,7 @@ public Long progressPercentage() { /** * Set the progressPercentage property: The progress of the operation in percentage. - * + * * @param progressPercentage the progressPercentage value to set. * @return the GalleryImageStatus object itself. */ @@ -146,7 +149,7 @@ public GalleryImageStatus withProgressPercentage(Long progressPercentage) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -157,4 +160,53 @@ public void validate() { 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 index 9c07cfb904f5..742549137704 100644 --- 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 @@ -5,24 +5,31 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The download status of the gallery image. + */ @Fluent -public final class GalleryImageStatusDownloadStatus { +public final class GalleryImageStatusDownloadStatus implements JsonSerializable { /* * The downloaded sized of the image in MB */ - @JsonProperty(value = "downloadSizeInMB") private Long downloadSizeInMB; - /** Creates an instance of GalleryImageStatusDownloadStatus class. */ + /** + * 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() { @@ -31,7 +38,7 @@ public Long 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. */ @@ -42,9 +49,47 @@ public GalleryImageStatusDownloadStatus withDownloadSizeInMB(Long downloadSizeIn /** * 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 index be6eb2f2b266..40c0b2782805 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The GalleryImageStatusProvisioningStatus model. + */ @Fluent -public final class GalleryImageStatusProvisioningStatus { +public final class GalleryImageStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the gallery image */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of GalleryImageStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public GalleryImageStatusProvisioningStatus withOperationId(String operationId) /** * Get the status property: The status of the operation performed on the gallery image [Succeeded, Failed, * InProgress]. - * + * * @return the status value. */ public Status status() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,49 @@ public GalleryImageStatusProvisioningStatus withStatus(Status status) { /** * 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 index 99a99d91ebae..7a62685d16fa 100644 --- 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 @@ -5,31 +5,37 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Specifies information about the gallery image version that you want to create or update. */ +/** + * Specifies information about the gallery image version that you want to create or update. + */ @Fluent -public final class GalleryImageVersion { +public final class GalleryImageVersion implements JsonSerializable { /* * This is the version of the gallery image. */ - @JsonProperty(value = "name") private String name; /* * Describes the properties of a gallery image version. */ - @JsonProperty(value = "properties") private GalleryImageVersionProperties innerProperties; - /** Creates an instance of GalleryImageVersion class. */ + /** + * 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() { @@ -38,7 +44,7 @@ public String 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. */ @@ -49,7 +55,7 @@ public GalleryImageVersion withName(String name) { /** * Get the innerProperties property: Describes the properties of a gallery image version. - * + * * @return the innerProperties value. */ private GalleryImageVersionProperties innerProperties() { @@ -58,7 +64,7 @@ private GalleryImageVersionProperties innerProperties() { /** * Get the storageProfile property: This is the storage profile of a Gallery Image Version. - * + * * @return the storageProfile value. */ public GalleryImageVersionStorageProfile storageProfile() { @@ -67,7 +73,7 @@ public GalleryImageVersionStorageProfile 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. */ @@ -81,7 +87,7 @@ public GalleryImageVersion withStorageProfile(GalleryImageVersionStorageProfile /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -89,4 +95,43 @@ public void validate() { 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 index c3c20e35b92b..07265a06d152 100644 --- 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 @@ -5,24 +5,31 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * This is the storage profile of a Gallery Image Version. + */ @Fluent -public final class GalleryImageVersionStorageProfile { +public final class GalleryImageVersionStorageProfile implements JsonSerializable { /* * This is the OS disk image. */ - @JsonProperty(value = "osDiskImage") private GalleryOSDiskImage osDiskImage; - /** Creates an instance of GalleryImageVersionStorageProfile class. */ + /** + * 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() { @@ -31,7 +38,7 @@ public GalleryOSDiskImage osDiskImage() { /** * Set the osDiskImage property: This is the OS disk image. - * + * * @param osDiskImage the osDiskImage value to set. * @return the GalleryImageVersionStorageProfile object itself. */ @@ -42,7 +49,7 @@ public GalleryImageVersionStorageProfile withOsDiskImage(GalleryOSDiskImage osDi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,41 @@ public void validate() { 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 index 15469df7298d..f307a6a78d4e 100644 --- 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 @@ -10,74 +10,76 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner; import java.util.Map; -/** An immutable client-side representation of GalleryImages. */ +/** + * 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(); @@ -85,21 +87,21 @@ public interface GalleryImages { /** * 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(); @@ -107,72 +109,77 @@ public interface GalleryImages { /** * 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 entirety of the GalleryImages definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The GalleryImages definition stages. */ + /** + * The GalleryImages definition stages. + */ interface DefinitionStages { - /** The first stage of the GalleryImages definition. */ + /** + * The first stage of the GalleryImages definition. + */ interface Blank extends WithLocation { } - /** The stage of the GalleryImages definition allowing to specify location. */ + /** + * 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. */ @@ -180,18 +187,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -203,128 +212,140 @@ interface WithResourceGroup { * 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 { + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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]. + * Azure]. * @return the next definition stage. */ WithCreate withCloudInitDataSource(CloudInitDataSource cloudInitDataSource); } - /** The stage of the GalleryImages definition allowing to specify hyperVGeneration. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -334,36 +355,42 @@ interface WithVersion { /** * Begins update for the GalleryImages resource. - * + * * @return the stage of resource update. */ GalleryImages.Update update(); - /** The template for GalleryImages 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. */ + /** + * The GalleryImages update stages. + */ interface UpdateStages { - /** The stage of the GalleryImages update allowing to specify tags. */ + /** + * 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. */ @@ -373,14 +400,14 @@ interface WithTags { /** * 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. */ 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 index d7b45e6f388a..c62e5d923b6c 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of gallery images. */ +/** + * List of gallery images. + */ @Fluent -public final class GalleryImagesListResult { +public final class GalleryImagesListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of GalleryImagesListResult class. */ + /** + * Creates an instance of GalleryImagesListResult class. + */ public GalleryImagesListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the GalleryImagesListResult object itself. */ @@ -50,7 +56,7 @@ public GalleryImagesListResult withValue(List value) { /** * Get the nextLink property: Link to the next set of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -67,4 +73,43 @@ public void validate() { 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 index 03a4b0103bb5..c6d82863087d 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of GalleryImagesOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface GalleryImagesOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new GalleryImages resource. - * + * * @param name resource name. * @return the first stage of the new GalleryImages definition. */ 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 index b1a470b1eb6b..590b27cc02b1 100644 --- 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 @@ -5,27 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The gallery images resource patch definition. + */ @Fluent -public final class GalleryImagesUpdateRequest { +public final class GalleryImagesUpdateRequest implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of GalleryImagesUpdateRequest class. */ + /** + * Creates an instance of GalleryImagesUpdateRequest class. + */ public GalleryImagesUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the GalleryImagesUpdateRequest object itself. */ @@ -45,9 +50,46 @@ public GalleryImagesUpdateRequest withTags(Map tags) { /** * 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/GalleryOSDiskImage.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java index ea35ace9757d..a630b512a5bc 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryOSDiskImage.java @@ -5,21 +5,79 @@ 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; -/** This is the OS disk image. */ +/** + * This is the OS disk image. + */ @Immutable public final class GalleryOSDiskImage extends GalleryDiskImage { - /** Creates an instance of GalleryOSDiskImage class. */ + /* + * This property indicates the size of the VHD to be created. + */ + private Long sizeInMB; + + /** + * Creates an instance of GalleryOSDiskImage class. + */ public GalleryOSDiskImage() { } + /** + * Get the sizeInMB property: This property indicates the size of the VHD to be created. + * + * @return the sizeInMB value. + */ + @Override + public Long sizeInMB() { + return this.sizeInMB; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryOSDiskImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 GalleryOSDiskImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryOSDiskImage deserializedGalleryOSDiskImage = new GalleryOSDiskImage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sizeInMB".equals(fieldName)) { + deserializedGalleryOSDiskImage.sizeInMB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + 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 index 22687d1dea99..5dd7eeecdbd1 100644 --- 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 @@ -7,67 +7,69 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; -/** An immutable client-side representation of GuestAgent. */ +/** + * 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 index 69050f0880e6..edcce50c17e0 100644 --- 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 @@ -6,50 +6,54 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Defines the status of a guest agent installation. + */ @Immutable -public final class GuestAgentInstallStatus { +public final class GuestAgentInstallStatus implements JsonSerializable { /* * Specifies the VM's unique SMBIOS ID. */ - @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) private String vmUuid; /* * The installation status of the hybrid machine agent installation. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private StatusTypes status; /* * The time of the last status change. */ - @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastStatusChange; /* * The hybrid machine agent full version. */ - @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) private String agentVersion; /* * Details about the error state. */ - @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) private List errorDetails; - /** Creates an instance of GuestAgentInstallStatus class. */ + /** + * 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() { @@ -58,7 +62,7 @@ public String vmUuid() { /** * Get the status property: The installation status of the hybrid machine agent installation. - * + * * @return the status value. */ public StatusTypes status() { @@ -67,7 +71,7 @@ public StatusTypes status() { /** * Get the lastStatusChange property: The time of the last status change. - * + * * @return the lastStatusChange value. */ public OffsetDateTime lastStatusChange() { @@ -76,7 +80,7 @@ public OffsetDateTime lastStatusChange() { /** * Get the agentVersion property: The hybrid machine agent full version. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -85,7 +89,7 @@ public String agentVersion() { /** * Get the errorDetails property: Details about the error state. - * + * * @return the errorDetails value. */ public List errorDetails() { @@ -94,9 +98,54 @@ public List 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 index 6f8fcd6d360a..bf2f9859e988 100644 --- 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 @@ -6,32 +6,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of GuestAgent. */ +/** + * List of GuestAgent. + */ @Fluent -public final class GuestAgentList { +public final class GuestAgentList implements JsonSerializable { /* * Url to follow for getting next page of GuestAgent. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * Array of GuestAgent */ - @JsonProperty(value = "value", required = true) private List value; - /** Creates an instance of GuestAgentList class. */ + /** + * 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() { @@ -40,7 +46,7 @@ public String 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. */ @@ -51,7 +57,7 @@ public GuestAgentList withNextLink(String nextLink) { /** * Get the value property: Array of GuestAgent. - * + * * @return the value value. */ public List value() { @@ -60,7 +66,7 @@ public List value() { /** * Set the value property: Array of GuestAgent. - * + * * @param value the value value to set. * @return the GuestAgentList object itself. */ @@ -71,18 +77,58 @@ public GuestAgentList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GuestAgentList")); + 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 index 5f021fd47ad1..e563437fca7e 100644 --- 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 @@ -8,15 +8,17 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner; -/** Resource collection API of GuestAgents. */ +/** + * Resource collection API of GuestAgents. + */ public interface GuestAgents { /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -26,11 +28,11 @@ public interface GuestAgents { /** * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * + * + * Create Or Update GuestAgent. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -42,11 +44,11 @@ public interface GuestAgents { /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -57,11 +59,11 @@ public interface GuestAgents { /** * Gets GuestAgent. - * - *

Implements GuestAgent GET method. - * + * + * Implements GuestAgent GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -71,11 +73,11 @@ public interface GuestAgents { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -84,11 +86,11 @@ public interface GuestAgents { /** * Deleted an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * + * + * Implements GuestAgent DELETE method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. 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 index 0269e3f058d7..b2ae9de0bad5 100644 --- 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 @@ -7,15 +7,17 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of GuestAgentsOperations. */ +/** + * Resource collection API of GuestAgentsOperations. + */ public interface GuestAgentsOperations { /** * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given 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. + * 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. @@ -25,11 +27,11 @@ public interface GuestAgentsOperations { /** * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given 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. + * 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. 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 index 4726ec54b76d..a8c36cb97cdb 100644 --- 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 @@ -5,30 +5,36 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Username / Password Credentials to connect to guest. + */ @Fluent -public final class GuestCredential { +public final class GuestCredential implements JsonSerializable { /* * The username to connect with the guest. */ - @JsonProperty(value = "username") private String username; /* * The password to connect with the guest. */ - @JsonProperty(value = "password") private String password; - /** Creates an instance of GuestCredential class. */ + /** + * 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() { @@ -37,7 +43,7 @@ public String username() { /** * Set the username property: The username to connect with the guest. - * + * * @param username the username value to set. * @return the GuestCredential object itself. */ @@ -48,7 +54,7 @@ public GuestCredential withUsername(String username) { /** * Get the password property: The password to connect with the guest. - * + * * @return the password value. */ public String password() { @@ -57,7 +63,7 @@ public String password() { /** * Set the password property: The password to connect with the guest. - * + * * @param password the password value to set. * @return the GuestCredential object itself. */ @@ -68,9 +74,48 @@ public GuestCredential withPassword(String password) { /** * 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 index 50605acb81d8..9d9fc0a870d4 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * HardwareProfile - Specifies the hardware settings for the virtual machine instance. + */ @Fluent -public final class HardwareProfileUpdate { +public final class HardwareProfileUpdate implements JsonSerializable { /* * The vmSize property. */ - @JsonProperty(value = "vmSize") private VmSizeEnum vmSize; /* * number of processors for the virtual machine instance */ - @JsonProperty(value = "processors") private Integer processors; /* * RAM in MB for the virtual machine instance */ - @JsonProperty(value = "memoryMB") private Long memoryMB; - /** Creates an instance of HardwareProfileUpdate class. */ + /** + * Creates an instance of HardwareProfileUpdate class. + */ public HardwareProfileUpdate() { } /** * Get the vmSize property: The vmSize property. - * + * * @return the vmSize value. */ public VmSizeEnum vmSize() { @@ -43,7 +48,7 @@ public VmSizeEnum vmSize() { /** * Set the vmSize property: The vmSize property. - * + * * @param vmSize the vmSize value to set. * @return the HardwareProfileUpdate object itself. */ @@ -54,7 +59,7 @@ public HardwareProfileUpdate withVmSize(VmSizeEnum vmSize) { /** * Get the processors property: number of processors for the virtual machine instance. - * + * * @return the processors value. */ public Integer processors() { @@ -63,7 +68,7 @@ public Integer 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. */ @@ -74,7 +79,7 @@ public HardwareProfileUpdate withProcessors(Integer processors) { /** * Get the memoryMB property: RAM in MB for the virtual machine instance. - * + * * @return the memoryMB value. */ public Long memoryMB() { @@ -83,7 +88,7 @@ public Long 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. */ @@ -94,9 +99,51 @@ public HardwareProfileUpdate withMemoryMB(Long memoryMB) { /** * 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/HciUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java new file mode 100644 index 000000000000..928464cf71b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java @@ -0,0 +1,937 @@ +// Copyright (c) Microsoft Corporation. All rights 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.HciUpdateInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of HciUpdate. + */ +public interface HciUpdate { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + OffsetDateTime installedDate(); + + /** + * Gets the description property: Description of the update. + * + * @return the description value. + */ + String description(); + + /** + * Gets the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + State state(); + + /** + * Gets the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + List prerequisites(); + + /** + * Gets the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + List componentVersions(); + + /** + * Gets the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + RebootRequirement rebootRequired(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + String packagePath(); + + /** + * Gets the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + Float packageSizeInMb(); + + /** + * Gets the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the version property: Version of the update. + * + * @return the version value. + */ + String version(); + + /** + * Gets the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + String releaseLink(); + + /** + * Gets the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + AvailabilityType availabilityType(); + + /** + * Gets the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + String packageType(); + + /** + * Gets the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + String additionalProperties(); + + /** + * Gets the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + Float progressPercentage(); + + /** + * Gets the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + String notifyMessage(); + + /** + * 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.HciUpdateInner object. + * + * @return the inner object. + */ + HciUpdateInner innerModel(); + + /** + * The entirety of the HciUpdate definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HciUpdate definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HciUpdate definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HciUpdate definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the 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.WithState, DefinitionStages.WithPrerequisites, + DefinitionStages.WithComponentVersions, DefinitionStages.WithRebootRequired, + DefinitionStages.WithHealthState, DefinitionStages.WithHealthCheckResult, + DefinitionStages.WithHealthCheckDate, DefinitionStages.WithPackagePath, + DefinitionStages.WithPackageSizeInMb, DefinitionStages.WithDisplayName, DefinitionStages.WithVersion, + DefinitionStages.WithPublisher, DefinitionStages.WithReleaseLink, DefinitionStages.WithAvailabilityType, + DefinitionStages.WithPackageType, DefinitionStages.WithAdditionalProperties, + DefinitionStages.WithProgressPercentage, DefinitionStages.WithNotifyMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + HciUpdate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HciUpdate create(Context context); + } + + /** + * The stage of the HciUpdate 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. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the HciUpdate definition allowing to specify installedDate. + */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + WithCreate withInstalledDate(OffsetDateTime installedDate); + } + + /** + * The stage of the HciUpdate definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the HciUpdate definition allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + WithCreate withState(State state); + } + + /** + * The stage of the HciUpdate definition allowing to specify prerequisites. + */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + WithCreate withPrerequisites(List prerequisites); + } + + /** + * The stage of the HciUpdate definition allowing to specify componentVersions. + */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + WithCreate withComponentVersions(List componentVersions); + } + + /** + * The stage of the HciUpdate definition allowing to specify rebootRequired. + */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + WithCreate withRebootRequired(RebootRequirement rebootRequired); + } + + /** + * The stage of the HciUpdate definition allowing to specify healthState. + */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + WithCreate withHealthState(HealthState healthState); + } + + /** + * The stage of the HciUpdate definition allowing to specify healthCheckResult. + */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + WithCreate withHealthCheckResult(List healthCheckResult); + } + + /** + * The stage of the HciUpdate definition allowing to specify healthCheckDate. + */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + WithCreate withHealthCheckDate(OffsetDateTime healthCheckDate); + } + + /** + * The stage of the HciUpdate definition allowing to specify packagePath. + */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + WithCreate withPackagePath(String packagePath); + } + + /** + * The stage of the HciUpdate definition allowing to specify packageSizeInMb. + */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + WithCreate withPackageSizeInMb(Float packageSizeInMb); + } + + /** + * The stage of the HciUpdate definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the HciUpdate definition allowing to specify version. + */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + + /** + * The stage of the HciUpdate definition allowing to specify publisher. + */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the HciUpdate definition allowing to specify releaseLink. + */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + WithCreate withReleaseLink(String releaseLink); + } + + /** + * The stage of the HciUpdate definition allowing to specify availabilityType. + */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + WithCreate withAvailabilityType(AvailabilityType availabilityType); + } + + /** + * The stage of the HciUpdate definition allowing to specify packageType. + */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + WithCreate withPackageType(String packageType); + } + + /** + * The stage of the HciUpdate definition allowing to specify additionalProperties. + */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(String additionalProperties); + } + + /** + * The stage of the HciUpdate definition allowing to specify progressPercentage. + */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + WithCreate withProgressPercentage(Float progressPercentage); + } + + /** + * The stage of the HciUpdate definition allowing to specify notifyMessage. + */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + WithCreate withNotifyMessage(String notifyMessage); + } + } + + /** + * Begins update for the HciUpdate resource. + * + * @return the stage of resource update. + */ + HciUpdate.Update update(); + + /** + * The template for HciUpdate update. + */ + 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. + * + * @return the updated resource. + */ + HciUpdate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HciUpdate apply(Context context); + } + + /** + * The HciUpdate update stages. + */ + interface UpdateStages { + /** + * The stage of the HciUpdate update allowing to specify installedDate. + */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + Update withInstalledDate(OffsetDateTime installedDate); + } + + /** + * The stage of the HciUpdate update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the HciUpdate update allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + Update withState(State state); + } + + /** + * The stage of the HciUpdate update allowing to specify prerequisites. + */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + Update withPrerequisites(List prerequisites); + } + + /** + * The stage of the HciUpdate update allowing to specify componentVersions. + */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + Update withComponentVersions(List componentVersions); + } + + /** + * The stage of the HciUpdate update allowing to specify rebootRequired. + */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + Update withRebootRequired(RebootRequirement rebootRequired); + } + + /** + * The stage of the HciUpdate update allowing to specify healthState. + */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + Update withHealthState(HealthState healthState); + } + + /** + * The stage of the HciUpdate update allowing to specify healthCheckResult. + */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + Update withHealthCheckResult(List healthCheckResult); + } + + /** + * The stage of the HciUpdate update allowing to specify healthCheckDate. + */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + Update withHealthCheckDate(OffsetDateTime healthCheckDate); + } + + /** + * The stage of the HciUpdate update allowing to specify packagePath. + */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + Update withPackagePath(String packagePath); + } + + /** + * The stage of the HciUpdate update allowing to specify packageSizeInMb. + */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + Update withPackageSizeInMb(Float packageSizeInMb); + } + + /** + * The stage of the HciUpdate update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the HciUpdate update allowing to specify version. + */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + Update withVersion(String version); + } + + /** + * The stage of the HciUpdate update allowing to specify publisher. + */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + + /** + * The stage of the HciUpdate update allowing to specify releaseLink. + */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + Update withReleaseLink(String releaseLink); + } + + /** + * The stage of the HciUpdate update allowing to specify availabilityType. + */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + Update withAvailabilityType(AvailabilityType availabilityType); + } + + /** + * The stage of the HciUpdate update allowing to specify packageType. + */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + Update withPackageType(String packageType); + } + + /** + * The stage of the HciUpdate update allowing to specify additionalProperties. + */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * @return the next definition stage. + */ + Update withAdditionalProperties(String additionalProperties); + } + + /** + * The stage of the HciUpdate update allowing to specify progressPercentage. + */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + Update withProgressPercentage(Float progressPercentage); + } + + /** + * The stage of the HciUpdate update allowing to specify notifyMessage. + */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + Update withNotifyMessage(String notifyMessage); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HciUpdate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HciUpdate refresh(Context context); + + /** + * Apply Update. + * + * @throws com.azure.core.management.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 post(); + + /** + * Apply Update. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java new file mode 100644 index 000000000000..601e8514e2e1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.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; + +/** + * Defines values for HealthState. + */ +public final class HealthState extends ExpandableStringEnum { + /** + * Static value Unknown for HealthState. + */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** + * Static value Success for HealthState. + */ + public static final HealthState SUCCESS = fromString("Success"); + + /** + * Static value Failure for HealthState. + */ + public static final HealthState FAILURE = fromString("Failure"); + + /** + * Static value Warning for HealthState. + */ + public static final HealthState WARNING = fromString("Warning"); + + /** + * Static value Error for HealthState. + */ + public static final HealthState ERROR = fromString("Error"); + + /** + * Static value InProgress for HealthState. + */ + public static final HealthState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of HealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HealthState() { + } + + /** + * Creates or finds a HealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthState. + */ + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * Gets known HealthState values. + * + * @return known HealthState values. + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.java new file mode 100644 index 000000000000..92b2b7e0f65a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HostNetwork.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; +import java.util.List; + +/** + * The HostNetwork of a cluster. + */ +@Fluent +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; + + /* + * 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 HostNetwork class. + */ + public HostNetwork() { + } + + /** + * 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; + } + + /** + * Set 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. + * + * @param intents the intents value to set. + * @return the HostNetwork object itself. + */ + public HostNetwork withIntents(List intents) { + this.intents = intents; + return this; + } + + /** + * Get the storageNetworks property: List of StorageNetworks config to deploy AzureStackHCI Cluster. + * + * @return the storageNetworks value. + */ + public List storageNetworks() { + return this.storageNetworks; + } + + /** + * Set the storageNetworks property: List of StorageNetworks config to deploy AzureStackHCI Cluster. + * + * @param storageNetworks the storageNetworks value to set. + * @return the HostNetwork object itself. + */ + public HostNetwork withStorageNetworks(List storageNetworks) { + this.storageNetworks = storageNetworks; + return this; + } + + /** + * 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; + } + + /** + * Set the storageConnectivitySwitchless property: Defines how the storage adapters between nodes are connected + * either switch or switch less.. + * + * @param storageConnectivitySwitchless the storageConnectivitySwitchless value to set. + * @return the HostNetwork object itself. + */ + public HostNetwork withStorageConnectivitySwitchless(Boolean storageConnectivitySwitchless) { + this.storageConnectivitySwitchless = storageConnectivitySwitchless; + return this; + } + + /** + * 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; + } + + /** + * Set 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. + * + * @param enableStorageAutoIp the enableStorageAutoIp value to set. + * @return the HostNetwork object itself. + */ + public HostNetwork withEnableStorageAutoIp(Boolean enableStorageAutoIp) { + this.enableStorageAutoIp = enableStorageAutoIp; + return this; + } + + /** + * 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(); + jsonWriter.writeArrayField("intents", this.intents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageNetworks", this.storageNetworks, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("storageConnectivitySwitchless", this.storageConnectivitySwitchless); + jsonWriter.writeBooleanField("enableStorageAutoIp", this.enableStorageAutoIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostNetwork from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 HostNetwork fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + 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 -> Intents.fromJson(reader1)); + deserializedHostNetwork.intents = intents; + } else if ("storageNetworks".equals(fieldName)) { + List storageNetworks + = reader.readArray(reader1 -> StorageNetworks.fromJson(reader1)); + deserializedHostNetwork.storageNetworks = storageNetworks; + } else if ("storageConnectivitySwitchless".equals(fieldName)) { + deserializedHostNetwork.storageConnectivitySwitchless = reader.getNullable(JsonReader::getBoolean); + } else if ("enableStorageAutoIp".equals(fieldName)) { + deserializedHostNetwork.enableStorageAutoIp = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + 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 index bc459f65f3ea..2dadf3af7919 100644 --- 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 @@ -5,43 +5,47 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * HTTP Proxy configuration for the VM. + */ @Fluent -public final class HttpProxyConfiguration { +public final class HttpProxyConfiguration implements JsonSerializable { /* * The HTTP proxy server endpoint to use. */ - @JsonProperty(value = "httpProxy") private String httpProxy; /* * The HTTPS proxy server endpoint to use. */ - @JsonProperty(value = "httpsProxy") private String httpsProxy; /* * The endpoints that should not go through proxy. */ - @JsonProperty(value = "noProxy") private List noProxy; /* * Alternative CA cert to use for connecting to proxy servers. */ - @JsonProperty(value = "trustedCa") private String trustedCa; - /** Creates an instance of HttpProxyConfiguration class. */ + /** + * 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() { @@ -50,7 +54,7 @@ public String httpProxy() { /** * Set the httpProxy property: The HTTP proxy server endpoint to use. - * + * * @param httpProxy the httpProxy value to set. * @return the HttpProxyConfiguration object itself. */ @@ -61,7 +65,7 @@ public HttpProxyConfiguration withHttpProxy(String httpProxy) { /** * Get the httpsProxy property: The HTTPS proxy server endpoint to use. - * + * * @return the httpsProxy value. */ public String httpsProxy() { @@ -70,7 +74,7 @@ public String httpsProxy() { /** * Set the httpsProxy property: The HTTPS proxy server endpoint to use. - * + * * @param httpsProxy the httpsProxy value to set. * @return the HttpProxyConfiguration object itself. */ @@ -81,7 +85,7 @@ public HttpProxyConfiguration withHttpsProxy(String httpsProxy) { /** * Get the noProxy property: The endpoints that should not go through proxy. - * + * * @return the noProxy value. */ public List noProxy() { @@ -90,7 +94,7 @@ public List 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. */ @@ -101,7 +105,7 @@ public HttpProxyConfiguration withNoProxy(List noProxy) { /** * Get the trustedCa property: Alternative CA cert to use for connecting to proxy servers. - * + * * @return the trustedCa value. */ public String trustedCa() { @@ -110,7 +114,7 @@ public String 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. */ @@ -121,9 +125,55 @@ public HttpProxyConfiguration withTrustedCa(String trustedCa) { /** * 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 index 38a783d69190..4f776773bee0 100644 --- 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 @@ -7,67 +7,69 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner; -/** An immutable client-side representation of HybridIdentityMetadata. */ +/** + * 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 index f42f2d10f731..bacb0bdfa7b9 100644 --- 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 @@ -6,32 +6,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of HybridIdentityMetadata. */ +/** + * List of HybridIdentityMetadata. + */ @Fluent -public final class HybridIdentityMetadataList { +public final class HybridIdentityMetadataList implements JsonSerializable { /* * Url to follow for getting next page of HybridIdentityMetadata. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * Array of HybridIdentityMetadata */ - @JsonProperty(value = "value", required = true) private List value; - /** Creates an instance of HybridIdentityMetadataList class. */ + /** + * 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() { @@ -40,7 +46,7 @@ public String 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. */ @@ -51,7 +57,7 @@ public HybridIdentityMetadataList withNextLink(String nextLink) { /** * Get the value property: Array of HybridIdentityMetadata. - * + * * @return the value value. */ public List value() { @@ -60,7 +66,7 @@ public List value() { /** * Set the value property: Array of HybridIdentityMetadata. - * + * * @param value the value value to set. * @return the HybridIdentityMetadataList object itself. */ @@ -71,19 +77,60 @@ public HybridIdentityMetadataList withValue(List va /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model HybridIdentityMetadataList")); + 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 index 0b5b16165043..f824e6f7fe03 100644 --- 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 @@ -8,15 +8,17 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of HybridIdentityMetadatas. */ +/** + * Resource collection API of HybridIdentityMetadatas. + */ public interface HybridIdentityMetadatas { /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -27,11 +29,11 @@ public interface HybridIdentityMetadatas { /** * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * + * + * Implements HybridIdentityMetadata GET method. + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. + * 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. @@ -41,11 +43,11 @@ public interface HybridIdentityMetadatas { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. @@ -55,11 +57,11 @@ public interface HybridIdentityMetadatas { /** * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given 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. + * 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. 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 index e5f05fad85da..f560c362399b 100644 --- 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 @@ -5,20 +5,25 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The hypervisor generation of the Virtual Machine [V1, V2]. */ +/** + * The hypervisor generation of the Virtual Machine [V1, V2]. + */ public final class HyperVGeneration extends ExpandableStringEnum { - /** Static value V1 for HyperVGeneration. */ + /** + * Static value V1 for HyperVGeneration. + */ public static final HyperVGeneration V1 = fromString("V1"); - /** Static value V2 for HyperVGeneration. */ + /** + * 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 @@ -27,18 +32,17 @@ public HyperVGeneration() { /** * Creates or finds a HyperVGeneration from its string representation. - * + * * @param name a name to look for. * @return the corresponding HyperVGeneration. */ - @JsonCreator public static HyperVGeneration fromString(String name) { return fromString(name, HyperVGeneration.class); } /** * Gets known HyperVGeneration values. - * + * * @return known HyperVGeneration values. */ public static Collection values() { 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 index 0f80a93fb7cf..c593acc3405b 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Identity for the resource. + */ @Fluent -public final class Identity { +public final class Identity implements JsonSerializable { /* * The principal ID of resource identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The tenant ID of resource. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * The identity type. */ - @JsonProperty(value = "type") private ResourceIdentityType type; - /** Creates an instance of Identity class. */ + /** + * 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() { @@ -43,7 +48,7 @@ public String principalId() { /** * Get the tenantId property: The tenant ID of resource. - * + * * @return the tenantId value. */ public String tenantId() { @@ -52,7 +57,7 @@ public String tenantId() { /** * Get the type property: The identity type. - * + * * @return the type value. */ public ResourceIdentityType type() { @@ -61,7 +66,7 @@ public ResourceIdentityType type() { /** * Set the type property: The identity type. - * + * * @param type the type value to set. * @return the Identity object itself. */ @@ -72,9 +77,49 @@ public Identity withType(ResourceIdentityType type) { /** * 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/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java new file mode 100644 index 000000000000..c5d63ac808b2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.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; + +/** + * IMDS attestation status of the cluster. + */ +public final class ImdsAttestation extends ExpandableStringEnum { + /** + * Static value Disabled for ImdsAttestation. + */ + public static final ImdsAttestation DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ImdsAttestation. + */ + public static final ImdsAttestation ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ImdsAttestation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImdsAttestation() { + } + + /** + * Creates or finds a ImdsAttestation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImdsAttestation. + */ + public static ImdsAttestation fromString(String name) { + return fromString(name, ImdsAttestation.class); + } + + /** + * Gets known ImdsAttestation values. + * + * @return known ImdsAttestation values. + */ + public static Collection values() { + return values(ImdsAttestation.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InfrastructureNetwork.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InfrastructureNetwork.java new file mode 100644 index 000000000000..61da13d90ea0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InfrastructureNetwork.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights 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 InfrastructureNetwork of a AzureStackHCI Cluster. + */ +@Fluent +public final class InfrastructureNetwork implements JsonSerializable { + /* + * Subnet mask that matches the provided IP address space. + */ + private String subnetMask; + + /* + * Default gateway that should be used for the provided IP address space. + */ + private String gateway; + + /* + * Range of IP addresses from which addresses are allocated for nodes within a subnet. + */ + private List ipPools; + + /* + * IPv4 address of the DNS servers in your environment. + */ + private List dnsServers; + + /* + * Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the deployment will default to static + * IPs. When true, GW and DNS servers are not required + */ + private Boolean useDhcp; + + /** + * Creates an instance of InfrastructureNetwork class. + */ + public InfrastructureNetwork() { + } + + /** + * Get the subnetMask property: Subnet mask that matches the provided IP address space. + * + * @return the subnetMask value. + */ + public String subnetMask() { + return this.subnetMask; + } + + /** + * Set the subnetMask property: Subnet mask that matches the provided IP address space. + * + * @param subnetMask the subnetMask value to set. + * @return the InfrastructureNetwork object itself. + */ + public InfrastructureNetwork withSubnetMask(String subnetMask) { + this.subnetMask = subnetMask; + return this; + } + + /** + * Get the gateway property: Default gateway that should be used for the provided IP address space. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway property: Default gateway that should be used for the provided IP address space. + * + * @param gateway the gateway value to set. + * @return the InfrastructureNetwork object itself. + */ + public InfrastructureNetwork withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the ipPools property: Range of IP addresses from which addresses are allocated for nodes within a subnet. + * + * @return the ipPools value. + */ + public List ipPools() { + return this.ipPools; + } + + /** + * Set the ipPools property: Range of IP addresses from which addresses are allocated for nodes within a subnet. + * + * @param ipPools the ipPools value to set. + * @return the InfrastructureNetwork object itself. + */ + public InfrastructureNetwork withIpPools(List ipPools) { + this.ipPools = ipPools; + return this; + } + + /** + * Get the dnsServers property: IPv4 address of the DNS servers in your environment. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: IPv4 address of the DNS servers in your environment. + * + * @param dnsServers the dnsServers value to set. + * @return the InfrastructureNetwork object itself. + */ + public InfrastructureNetwork withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the useDhcp property: Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the deployment + * will default to static IPs. When true, GW and DNS servers are not required. + * + * @return the useDhcp value. + */ + public Boolean useDhcp() { + return this.useDhcp; + } + + /** + * Set the useDhcp property: Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the deployment + * will default to static IPs. When true, GW and DNS servers are not required. + * + * @param useDhcp the useDhcp value to set. + * @return the InfrastructureNetwork object itself. + */ + public InfrastructureNetwork withUseDhcp(Boolean useDhcp) { + this.useDhcp = useDhcp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipPools() != null) { + ipPools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetMask", this.subnetMask); + jsonWriter.writeStringField("gateway", this.gateway); + jsonWriter.writeArrayField("ipPools", this.ipPools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("useDhcp", this.useDhcp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InfrastructureNetwork from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InfrastructureNetwork 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 InfrastructureNetwork. + */ + public static InfrastructureNetwork fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InfrastructureNetwork deserializedInfrastructureNetwork = new InfrastructureNetwork(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetMask".equals(fieldName)) { + deserializedInfrastructureNetwork.subnetMask = reader.getString(); + } else if ("gateway".equals(fieldName)) { + deserializedInfrastructureNetwork.gateway = reader.getString(); + } else if ("ipPools".equals(fieldName)) { + List ipPools = reader.readArray(reader1 -> IpPools.fromJson(reader1)); + deserializedInfrastructureNetwork.ipPools = ipPools; + } else if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedInfrastructureNetwork.dnsServers = dnsServers; + } else if ("useDhcp".equals(fieldName)) { + deserializedInfrastructureNetwork.useDhcp = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedInfrastructureNetwork; + }); + } +} 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 index 55ebed95826c..da1db2eb9199 100644 --- 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 @@ -5,49 +5,54 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Instance view status. + */ @Fluent -public final class InstanceViewStatus { +public final class InstanceViewStatus implements JsonSerializable { /* * The status code. */ - @JsonProperty(value = "code") private String code; /* * The level code. */ - @JsonProperty(value = "level") private StatusLevelTypes level; /* * The short localizable label for the status. */ - @JsonProperty(value = "displayStatus") private String displayStatus; /* * The detailed status message, including for alerts and error messages. */ - @JsonProperty(value = "message") private String message; /* * The time of the status. */ - @JsonProperty(value = "time") private OffsetDateTime time; - /** Creates an instance of InstanceViewStatus class. */ + /** + * Creates an instance of InstanceViewStatus class. + */ public InstanceViewStatus() { } /** * Get the code property: The status code. - * + * * @return the code value. */ public String code() { @@ -56,7 +61,7 @@ public String code() { /** * Set the code property: The status code. - * + * * @param code the code value to set. * @return the InstanceViewStatus object itself. */ @@ -67,7 +72,7 @@ public InstanceViewStatus withCode(String code) { /** * Get the level property: The level code. - * + * * @return the level value. */ public StatusLevelTypes level() { @@ -76,7 +81,7 @@ public StatusLevelTypes level() { /** * Set the level property: The level code. - * + * * @param level the level value to set. * @return the InstanceViewStatus object itself. */ @@ -87,7 +92,7 @@ public InstanceViewStatus withLevel(StatusLevelTypes level) { /** * Get the displayStatus property: The short localizable label for the status. - * + * * @return the displayStatus value. */ public String displayStatus() { @@ -96,7 +101,7 @@ public String displayStatus() { /** * Set the displayStatus property: The short localizable label for the status. - * + * * @param displayStatus the displayStatus value to set. * @return the InstanceViewStatus object itself. */ @@ -107,7 +112,7 @@ public InstanceViewStatus withDisplayStatus(String displayStatus) { /** * Get the message property: The detailed status message, including for alerts and error messages. - * + * * @return the message value. */ public String message() { @@ -116,7 +121,7 @@ public String 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. */ @@ -127,7 +132,7 @@ public InstanceViewStatus withMessage(String message) { /** * Get the time property: The time of the status. - * + * * @return the time value. */ public OffsetDateTime time() { @@ -136,7 +141,7 @@ public OffsetDateTime time() { /** * Set the time property: The time of the status. - * + * * @param time the time value to set. * @return the InstanceViewStatus object itself. */ @@ -147,9 +152,59 @@ public InstanceViewStatus withTime(OffsetDateTime time) { /** * 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/Intents.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Intents.java new file mode 100644 index 000000000000..3a11ff2adb41 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Intents.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights 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 Intents of a cluster. + */ +@Fluent +public final class Intents implements JsonSerializable { + /* + * Name of the network intent you wish to create. + */ + private String name; + + /* + * List of network traffic types. Only allowed values are 'Compute', 'Storage', 'Management'. + */ + private List trafficType; + + /* + * Array of network interfaces used for the network intent. + */ + private List adapter; + + /* + * 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 VirtualSwitchConfigurationOverrides 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 AdapterPropertyOverrides adapterPropertyOverrides; + + /** + * Creates an instance of Intents class. + */ + public Intents() { + } + + /** + * Get the name property: Name of the network intent you wish to create. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network intent you wish to create. + * + * @param name the name value to set. + * @return the Intents object itself. + */ + public Intents withName(String name) { + this.name = name; + return this; + } + + /** + * Get the trafficType property: List of network traffic types. Only allowed values are 'Compute', 'Storage', + * 'Management'. + * + * @return the trafficType value. + */ + public List trafficType() { + return this.trafficType; + } + + /** + * Set the trafficType property: List of network traffic types. Only allowed values are 'Compute', 'Storage', + * 'Management'. + * + * @param trafficType the trafficType value to set. + * @return the Intents object itself. + */ + public Intents withTrafficType(List trafficType) { + this.trafficType = trafficType; + return this; + } + + /** + * Get the adapter property: Array of network interfaces used for the network intent. + * + * @return the adapter value. + */ + public List adapter() { + return this.adapter; + } + + /** + * Set the adapter property: Array of network interfaces used for the network intent. + * + * @param adapter the adapter value to set. + * @return the Intents object itself. + */ + public Intents withAdapter(List adapter) { + this.adapter = adapter; + return this; + } + + /** + * 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; + } + + /** + * Set the overrideVirtualSwitchConfiguration property: This parameter should only be modified based on your OEM + * guidance. Do not modify this parameter without OEM validation. + * + * @param overrideVirtualSwitchConfiguration the overrideVirtualSwitchConfiguration value to set. + * @return the Intents object itself. + */ + public Intents withOverrideVirtualSwitchConfiguration(Boolean overrideVirtualSwitchConfiguration) { + this.overrideVirtualSwitchConfiguration = overrideVirtualSwitchConfiguration; + return this; + } + + /** + * Get the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster. + * + * @return the virtualSwitchConfigurationOverrides value. + */ + public VirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides() { + return this.virtualSwitchConfigurationOverrides; + } + + /** + * Set the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster. + * + * @param virtualSwitchConfigurationOverrides the virtualSwitchConfigurationOverrides value to set. + * @return the Intents object itself. + */ + public Intents withVirtualSwitchConfigurationOverrides( + VirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides) { + this.virtualSwitchConfigurationOverrides = virtualSwitchConfigurationOverrides; + return this; + } + + /** + * 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; + } + + /** + * Set the overrideQosPolicy property: This parameter should only be modified based on your OEM guidance. Do not + * modify this parameter without OEM validation. + * + * @param overrideQosPolicy the overrideQosPolicy value to set. + * @return the Intents object itself. + */ + public Intents withOverrideQosPolicy(Boolean overrideQosPolicy) { + this.overrideQosPolicy = overrideQosPolicy; + return this; + } + + /** + * Get the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster. + * + * @return the qosPolicyOverrides value. + */ + public QosPolicyOverrides qosPolicyOverrides() { + return this.qosPolicyOverrides; + } + + /** + * Set the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster. + * + * @param qosPolicyOverrides the qosPolicyOverrides value to set. + * @return the Intents object itself. + */ + public Intents withQosPolicyOverrides(QosPolicyOverrides qosPolicyOverrides) { + this.qosPolicyOverrides = qosPolicyOverrides; + return this; + } + + /** + * 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; + } + + /** + * Set the overrideAdapterProperty property: This parameter should only be modified based on your OEM guidance. Do + * not modify this parameter without OEM validation. + * + * @param overrideAdapterProperty the overrideAdapterProperty value to set. + * @return the Intents object itself. + */ + public Intents withOverrideAdapterProperty(Boolean overrideAdapterProperty) { + this.overrideAdapterProperty = overrideAdapterProperty; + return this; + } + + /** + * Get the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster. + * + * @return the adapterPropertyOverrides value. + */ + public AdapterPropertyOverrides adapterPropertyOverrides() { + return this.adapterPropertyOverrides; + } + + /** + * Set the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster. + * + * @param adapterPropertyOverrides the adapterPropertyOverrides value to set. + * @return the Intents object itself. + */ + public Intents withAdapterPropertyOverrides(AdapterPropertyOverrides adapterPropertyOverrides) { + this.adapterPropertyOverrides = adapterPropertyOverrides; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("trafficType", this.trafficType, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("adapter", this.adapter, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("overrideVirtualSwitchConfiguration", this.overrideVirtualSwitchConfiguration); + jsonWriter.writeJsonField("virtualSwitchConfigurationOverrides", this.virtualSwitchConfigurationOverrides); + jsonWriter.writeBooleanField("overrideQosPolicy", this.overrideQosPolicy); + jsonWriter.writeJsonField("qosPolicyOverrides", this.qosPolicyOverrides); + jsonWriter.writeBooleanField("overrideAdapterProperty", this.overrideAdapterProperty); + jsonWriter.writeJsonField("adapterPropertyOverrides", this.adapterPropertyOverrides); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Intents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 Intents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Intents deserializedIntents = new Intents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIntents.name = reader.getString(); + } else if ("trafficType".equals(fieldName)) { + List trafficType = reader.readArray(reader1 -> reader1.getString()); + deserializedIntents.trafficType = trafficType; + } else if ("adapter".equals(fieldName)) { + List adapter = reader.readArray(reader1 -> reader1.getString()); + deserializedIntents.adapter = adapter; + } else if ("overrideVirtualSwitchConfiguration".equals(fieldName)) { + deserializedIntents.overrideVirtualSwitchConfiguration = reader.getNullable(JsonReader::getBoolean); + } else if ("virtualSwitchConfigurationOverrides".equals(fieldName)) { + deserializedIntents.virtualSwitchConfigurationOverrides + = VirtualSwitchConfigurationOverrides.fromJson(reader); + } else if ("overrideQosPolicy".equals(fieldName)) { + deserializedIntents.overrideQosPolicy = reader.getNullable(JsonReader::getBoolean); + } else if ("qosPolicyOverrides".equals(fieldName)) { + deserializedIntents.qosPolicyOverrides = QosPolicyOverrides.fromJson(reader); + } else if ("overrideAdapterProperty".equals(fieldName)) { + deserializedIntents.overrideAdapterProperty = reader.getNullable(JsonReader::getBoolean); + } else if ("adapterPropertyOverrides".equals(fieldName)) { + deserializedIntents.adapterPropertyOverrides = AdapterPropertyOverrides.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + 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 index 5020b815a679..9d7b922c40c8 100644 --- 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 @@ -5,25 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The InterfaceDnsSettings model. + */ @Fluent -public final class InterfaceDnsSettings { +public final class InterfaceDnsSettings implements JsonSerializable { /* * List of DNS server IP Addresses for the interface */ - @JsonProperty(value = "dnsServers") private List dnsServers; - /** Creates an instance of InterfaceDnsSettings class. */ + /** + * 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() { @@ -32,7 +39,7 @@ public List 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. */ @@ -43,9 +50,46 @@ public InterfaceDnsSettings withDnsServers(List dnsServers) { /** * 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 index 372b2b2b943a..58d99a41ecca 100644 --- 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 @@ -5,20 +5,25 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic'. */ +/** + * IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic'. + */ public final class IpAllocationMethodEnum extends ExpandableStringEnum { - /** Static value Dynamic for IpAllocationMethodEnum. */ + /** + * Static value Dynamic for IpAllocationMethodEnum. + */ public static final IpAllocationMethodEnum DYNAMIC = fromString("Dynamic"); - /** Static value Static for IpAllocationMethodEnum. */ + /** + * 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 @@ -27,18 +32,17 @@ public IpAllocationMethodEnum() { /** * Creates or finds a IpAllocationMethodEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding IpAllocationMethodEnum. */ - @JsonCreator public static IpAllocationMethodEnum fromString(String name) { return fromString(name, IpAllocationMethodEnum.class); } /** * Gets known IpAllocationMethodEnum values. - * + * * @return known IpAllocationMethodEnum values. */ public static Collection values() { 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 index 08f62574c41c..6d44550633a6 100644 --- 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 @@ -5,32 +5,38 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * InterfaceIPConfiguration iPConfiguration in a network interface. + */ @Fluent -public final class IpConfiguration { +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. */ - @JsonProperty(value = "name") private String name; /* * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. */ - @JsonProperty(value = "properties") private IpConfigurationProperties properties; - /** Creates an instance of IpConfiguration class. */ + /** + * 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() { @@ -40,7 +46,7 @@ public String 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. */ @@ -51,7 +57,7 @@ public IpConfiguration withName(String name) { /** * Get the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. - * + * * @return the properties value. */ public IpConfigurationProperties properties() { @@ -60,7 +66,7 @@ public IpConfigurationProperties properties() { /** * Set the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. - * + * * @param properties the properties value to set. * @return the IpConfiguration object itself. */ @@ -71,7 +77,7 @@ public IpConfiguration withProperties(IpConfigurationProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +85,43 @@ public void validate() { 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 index 4a635287f67e..aac4f25d5808 100644 --- 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 @@ -5,42 +5,46 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + */ @Fluent -public final class IpConfigurationProperties { +public final class IpConfigurationProperties implements JsonSerializable { /* * Gateway for network interface */ - @JsonProperty(value = "gateway", access = JsonProperty.Access.WRITE_ONLY) private String gateway; /* * prefixLength for network interface */ - @JsonProperty(value = "prefixLength", access = JsonProperty.Access.WRITE_ONLY) private String prefixLength; /* * PrivateIPAddress - Private IP address of the IP configuration. */ - @JsonProperty(value = "privateIPAddress") private String privateIpAddress; /* * Subnet - Name of Subnet bound to the IP configuration. */ - @JsonProperty(value = "subnet") private IpConfigurationPropertiesSubnet subnet; - /** Creates an instance of IpConfigurationProperties class. */ + /** + * Creates an instance of IpConfigurationProperties class. + */ public IpConfigurationProperties() { } /** * Get the gateway property: Gateway for network interface. - * + * * @return the gateway value. */ public String gateway() { @@ -49,7 +53,7 @@ public String gateway() { /** * Get the prefixLength property: prefixLength for network interface. - * + * * @return the prefixLength value. */ public String prefixLength() { @@ -58,7 +62,7 @@ public String prefixLength() { /** * Get the privateIpAddress property: PrivateIPAddress - Private IP address of the IP configuration. - * + * * @return the privateIpAddress value. */ public String privateIpAddress() { @@ -67,7 +71,7 @@ public String 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. */ @@ -78,7 +82,7 @@ public IpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { /** * Get the subnet property: Subnet - Name of Subnet bound to the IP configuration. - * + * * @return the subnet value. */ public IpConfigurationPropertiesSubnet subnet() { @@ -87,7 +91,7 @@ public IpConfigurationPropertiesSubnet 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. */ @@ -98,7 +102,7 @@ public IpConfigurationProperties withSubnet(IpConfigurationPropertiesSubnet subn /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -106,4 +110,47 @@ public void validate() { 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 index 3fb374bdaaed..ed04e6e637db 100644 --- 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 @@ -5,25 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Subnet - Name of Subnet bound to the IP configuration. + */ @Fluent -public final class IpConfigurationPropertiesSubnet { +public final class IpConfigurationPropertiesSubnet implements JsonSerializable { /* * ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of IpConfigurationPropertiesSubnet class. */ + /** + * 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() { @@ -33,7 +40,7 @@ public String 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. */ @@ -44,9 +51,46 @@ public IpConfigurationPropertiesSubnet withId(String id) { /** * 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 index 4e1a4e3ec84a..04231ea88859 100644 --- 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 @@ -5,48 +5,51 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The IpPool model. */ +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 { +public final class IpPool implements JsonSerializable { /* * Name of the IP-Pool */ - @JsonProperty(value = "name") private String name; /* * Type of the IP Pool [vm, vippool] */ - @JsonProperty(value = "ipPoolType") private IpPoolTypeEnum ipPoolType; /* * Start of the IP address pool */ - @JsonProperty(value = "start") private String start; /* * End of the IP address pool */ - @JsonProperty(value = "end") private String end; /* * The info property. */ - @JsonProperty(value = "info") private IpPoolInfo info; - /** Creates an instance of IpPool class. */ + /** + * Creates an instance of IpPool class. + */ public IpPool() { } /** * Get the name property: Name of the IP-Pool. - * + * * @return the name value. */ public String name() { @@ -55,7 +58,7 @@ public String name() { /** * Set the name property: Name of the IP-Pool. - * + * * @param name the name value to set. * @return the IpPool object itself. */ @@ -66,7 +69,7 @@ public IpPool withName(String name) { /** * Get the ipPoolType property: Type of the IP Pool [vm, vippool]. - * + * * @return the ipPoolType value. */ public IpPoolTypeEnum ipPoolType() { @@ -75,7 +78,7 @@ public IpPoolTypeEnum ipPoolType() { /** * Set the ipPoolType property: Type of the IP Pool [vm, vippool]. - * + * * @param ipPoolType the ipPoolType value to set. * @return the IpPool object itself. */ @@ -86,7 +89,7 @@ public IpPool withIpPoolType(IpPoolTypeEnum ipPoolType) { /** * Get the start property: Start of the IP address pool. - * + * * @return the start value. */ public String start() { @@ -95,7 +98,7 @@ public String start() { /** * Set the start property: Start of the IP address pool. - * + * * @param start the start value to set. * @return the IpPool object itself. */ @@ -106,7 +109,7 @@ public IpPool withStart(String start) { /** * Get the end property: End of the IP address pool. - * + * * @return the end value. */ public String end() { @@ -115,7 +118,7 @@ public String end() { /** * Set the end property: End of the IP address pool. - * + * * @param end the end value to set. * @return the IpPool object itself. */ @@ -126,7 +129,7 @@ public IpPool withEnd(String end) { /** * Get the info property: The info property. - * + * * @return the info value. */ public IpPoolInfo info() { @@ -135,7 +138,7 @@ public IpPoolInfo info() { /** * Set the info property: The info property. - * + * * @param info the info value to set. * @return the IpPool object itself. */ @@ -146,7 +149,7 @@ public IpPool withInfo(IpPoolInfo info) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -154,4 +157,52 @@ public void validate() { 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 index 6d2dd2e314d7..d13a6e12c515 100644 --- 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 @@ -5,30 +5,36 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The IpPoolInfo model. + */ @Immutable -public final class IpPoolInfo { +public final class IpPoolInfo implements JsonSerializable { /* * Number of IP addresses allocated from the IP Pool */ - @JsonProperty(value = "used", access = JsonProperty.Access.WRITE_ONLY) private String used; /* * Number of IP addresses available in the IP Pool */ - @JsonProperty(value = "available", access = JsonProperty.Access.WRITE_ONLY) private String available; - /** Creates an instance of IpPoolInfo class. */ + /** + * 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() { @@ -37,7 +43,7 @@ public String used() { /** * Get the available property: Number of IP addresses available in the IP Pool. - * + * * @return the available value. */ public String available() { @@ -46,9 +52,46 @@ public String 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 index b300c2bb91c0..3ecda044e41f 100644 --- 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 @@ -4,18 +4,23 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Type of the IP Pool [vm, vippool]. */ +/** + * Type of the IP Pool [vm, vippool]. + */ public enum IpPoolTypeEnum { - /** Enum value vm. */ + /** + * Enum value vm. + */ VM("vm"), - /** Enum value vippool. */ + /** + * Enum value vippool. + */ VIPPOOL("vippool"); - /** The actual serialized value for a IpPoolTypeEnum instance. */ + /** + * The actual serialized value for a IpPoolTypeEnum instance. + */ private final String value; IpPoolTypeEnum(String value) { @@ -24,11 +29,10 @@ public enum IpPoolTypeEnum { /** * 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. */ - @JsonCreator public static IpPoolTypeEnum fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static IpPoolTypeEnum fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPools.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPools.java new file mode 100644 index 000000000000..dbc78df4ffff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPools.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; + +/** + * The dnsServers of a device. + */ +@Fluent +public final class IpPools implements JsonSerializable { + /* + * Starting IP address for the management network. A minimum of six free, contiguous IPv4 addresses (excluding your + * host IPs) are needed for infrastructure services such as clustering. + */ + private String startingAddress; + + /* + * Ending IP address for the management network. A minimum of six free, contiguous IPv4 addresses (excluding your + * host IPs) are needed for infrastructure services such as clustering. + */ + private String endingAddress; + + /** + * Creates an instance of IpPools class. + */ + public IpPools() { + } + + /** + * Get the startingAddress property: Starting IP address for the management network. A minimum of six free, + * contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such as clustering. + * + * @return the startingAddress value. + */ + public String startingAddress() { + return this.startingAddress; + } + + /** + * Set the startingAddress property: Starting IP address for the management network. A minimum of six free, + * contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such as clustering. + * + * @param startingAddress the startingAddress value to set. + * @return the IpPools object itself. + */ + public IpPools withStartingAddress(String startingAddress) { + this.startingAddress = startingAddress; + return this; + } + + /** + * Get the endingAddress property: Ending IP address for the management network. A minimum of six free, contiguous + * IPv4 addresses (excluding your host IPs) are needed for infrastructure services such as clustering. + * + * @return the endingAddress value. + */ + public String endingAddress() { + return this.endingAddress; + } + + /** + * Set the endingAddress property: Ending IP address for the management network. A minimum of six free, contiguous + * IPv4 addresses (excluding your host IPs) are needed for infrastructure services such as clustering. + * + * @param endingAddress the endingAddress value to set. + * @return the IpPools object itself. + */ + public IpPools withEndingAddress(String endingAddress) { + this.endingAddress = endingAddress; + 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("startingAddress", this.startingAddress); + jsonWriter.writeStringField("endingAddress", this.endingAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpPools from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpPools 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 IpPools. + */ + public static IpPools fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpPools deserializedIpPools = new IpPools(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startingAddress".equals(fieldName)) { + deserializedIpPools.startingAddress = reader.getString(); + } else if ("endingAddress".equals(fieldName)) { + deserializedIpPools.endingAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpPools; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java new file mode 100644 index 000000000000..79ad6b9cde8c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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; + +/** + * Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. + */ +@Immutable +public final class IsolatedVmAttestationConfiguration implements JsonSerializable { + /* + * Fully qualified Azure resource id of the Microsoft Azure attestation resource associated with this cluster. + */ + private String attestationResourceId; + + /* + * Region specific endpoint for relying party service. + */ + private String relyingPartyServiceEndpoint; + + /* + * Region specific endpoint for Microsoft Azure Attestation service for the cluster + */ + private String attestationServiceEndpoint; + + /** + * Creates an instance of IsolatedVmAttestationConfiguration class. + */ + public IsolatedVmAttestationConfiguration() { + } + + /** + * Get the attestationResourceId property: Fully qualified Azure resource id of the Microsoft Azure attestation + * resource associated with this cluster. + * + * @return the attestationResourceId value. + */ + public String attestationResourceId() { + return this.attestationResourceId; + } + + /** + * Get the relyingPartyServiceEndpoint property: Region specific endpoint for relying party service. + * + * @return the relyingPartyServiceEndpoint value. + */ + public String relyingPartyServiceEndpoint() { + return this.relyingPartyServiceEndpoint; + } + + /** + * Get the attestationServiceEndpoint property: Region specific endpoint for Microsoft Azure Attestation service for + * the cluster. + * + * @return the attestationServiceEndpoint value. + */ + public String attestationServiceEndpoint() { + return this.attestationServiceEndpoint; + } + + /** + * 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 IsolatedVmAttestationConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IsolatedVmAttestationConfiguration 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 IsolatedVmAttestationConfiguration. + */ + public static IsolatedVmAttestationConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IsolatedVmAttestationConfiguration deserializedIsolatedVmAttestationConfiguration + = new IsolatedVmAttestationConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attestationResourceId".equals(fieldName)) { + deserializedIsolatedVmAttestationConfiguration.attestationResourceId = reader.getString(); + } else if ("relyingPartyServiceEndpoint".equals(fieldName)) { + deserializedIsolatedVmAttestationConfiguration.relyingPartyServiceEndpoint = reader.getString(); + } else if ("attestationServiceEndpoint".equals(fieldName)) { + deserializedIsolatedVmAttestationConfiguration.attestationServiceEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIsolatedVmAttestationConfiguration; + }); + } +} 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 index 0be52c83c9f9..a89be0ed0218 100644 --- 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 @@ -5,7 +5,11 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** @@ -13,20 +17,22 @@ * for a subnet overrides logical network DHCP options. */ @Fluent -public final class LogicalNetworkPropertiesDhcpOptions { +public final class LogicalNetworkPropertiesDhcpOptions + implements JsonSerializable { /* * The list of DNS servers IP addresses. */ - @JsonProperty(value = "dnsServers") private List dnsServers; - /** Creates an instance of LogicalNetworkPropertiesDhcpOptions class. */ + /** + * 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() { @@ -35,7 +41,7 @@ public List dnsServers() { /** * Set the dnsServers property: The list of DNS servers IP addresses. - * + * * @param dnsServers the dnsServers value to set. * @return the LogicalNetworkPropertiesDhcpOptions object itself. */ @@ -46,9 +52,47 @@ public LogicalNetworkPropertiesDhcpOptions withDnsServers(List dnsServer /** * 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 index 9ee0a55ce7b4..ecfd9ccbabd5 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The observed state of logical networks. + */ @Fluent -public final class LogicalNetworkStatus { +public final class LogicalNetworkStatus implements JsonSerializable { /* * LogicalNetwork provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private LogicalNetworkStatusProvisioningStatus provisioningStatus; - /** Creates an instance of LogicalNetworkStatus class. */ + /** + * Creates an instance of LogicalNetworkStatus class. + */ public LogicalNetworkStatus() { } /** * Get the errorCode property: LogicalNetwork provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -43,7 +48,7 @@ public String errorCode() { /** * Set the errorCode property: LogicalNetwork provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the LogicalNetworkStatus object itself. */ @@ -54,7 +59,7 @@ public LogicalNetworkStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -63,7 +68,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the LogicalNetworkStatus object itself. */ @@ -74,7 +79,7 @@ public LogicalNetworkStatus withErrorMessage(String errorMessage) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public LogicalNetworkStatusProvisioningStatus provisioningStatus() { @@ -83,7 +88,7 @@ public LogicalNetworkStatusProvisioningStatus provisioningStatus() { /** * Set the provisioningStatus property: The provisioningStatus property. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the LogicalNetworkStatus object itself. */ @@ -94,7 +99,7 @@ public LogicalNetworkStatus withProvisioningStatus(LogicalNetworkStatusProvision /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -102,4 +107,47 @@ public void validate() { 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 index 6602733fd75b..f521fa30f219 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The LogicalNetworkStatusProvisioningStatus model. + */ @Fluent -public final class LogicalNetworkStatusProvisioningStatus { +public final class LogicalNetworkStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the logical network */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the logical network [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of LogicalNetworkStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public LogicalNetworkStatusProvisioningStatus withOperationId(String operationId /** * Get the status property: The status of the operation performed on the logical network [Succeeded, Failed, * InProgress]. - * + * * @return the status value. */ public Status status() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,49 @@ public LogicalNetworkStatusProvisioningStatus withStatus(Status status) { /** * 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 index 3d10d21f536b..773d035379bf 100644 --- 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 @@ -11,53 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of LogicalNetworks. */ +/** + * 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(); @@ -65,86 +67,91 @@ public interface LogicalNetworks { /** * 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 entirety of the LogicalNetworks definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The LogicalNetworks definition stages. */ + /** + * The LogicalNetworks definition stages. + */ interface DefinitionStages { - /** The first stage of the LogicalNetworks definition. */ + /** + * The first stage of the LogicalNetworks definition. + */ interface Blank extends WithLocation { } - /** The stage of the LogicalNetworks definition allowing to specify location. */ + /** + * 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. */ @@ -152,18 +159,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -174,80 +183,86 @@ interface WithResourceGroup { * 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 { + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -257,36 +272,42 @@ interface WithVmSwitchName { /** * Begins update for the LogicalNetworks resource. - * + * * @return the stage of resource update. */ LogicalNetworks.Update update(); - /** The template for LogicalNetworks 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. */ + /** + * The LogicalNetworks update stages. + */ interface UpdateStages { - /** The stage of the LogicalNetworks update allowing to specify tags. */ + /** + * 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. */ @@ -296,14 +317,14 @@ interface WithTags { /** * 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. */ 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 index a46053639de5..abbc5ea78d88 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The LogicalNetworksListResult model. */ +/** + * The LogicalNetworksListResult model. + */ @Fluent -public final class LogicalNetworksListResult { +public final class LogicalNetworksListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of LogicalNetworksListResult class. */ + /** + * Creates an instance of LogicalNetworksListResult class. + */ public LogicalNetworksListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the LogicalNetworksListResult object itself. */ @@ -50,7 +56,7 @@ public LogicalNetworksListResult withValue(List value) { /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The nextLink property. - * + * * @param nextLink the nextLink value to set. * @return the LogicalNetworksListResult object itself. */ @@ -70,7 +76,7 @@ public LogicalNetworksListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { 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 index 54553a80db4b..b68adcd17ec3 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of LogicalNetworksOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface LogicalNetworksOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new LogicalNetworks resource. - * + * * @param name resource name. * @return the first stage of the new LogicalNetworks definition. */ 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 index be53f339f277..15e140cdaf0a 100644 --- 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 @@ -5,27 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The logical network resource patch definition. + */ @Fluent -public final class LogicalNetworksUpdateRequest { +public final class LogicalNetworksUpdateRequest implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of LogicalNetworksUpdateRequest class. */ + /** + * Creates an instance of LogicalNetworksUpdateRequest class. + */ public LogicalNetworksUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the LogicalNetworksUpdateRequest object itself. */ @@ -45,9 +50,46 @@ public LogicalNetworksUpdateRequest withTags(Map tags) { /** * 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/ManagedServiceIdentityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..1c59b4172aa6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} 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 index cc7bf491fedd..52107a26e9ec 100644 --- 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 @@ -5,48 +5,51 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The observed state of marketplace gallery images. */ +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 { +public final class MarketplaceGalleryImageStatus implements JsonSerializable { /* * MarketplaceGalleryImage provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus; /* * The download status of the gallery image */ - @JsonProperty(value = "downloadStatus") private MarketplaceGalleryImageStatusDownloadStatus downloadStatus; /* * The progress of the operation in percentage */ - @JsonProperty(value = "progressPercentage") private Long progressPercentage; - /** Creates an instance of MarketplaceGalleryImageStatus class. */ + /** + * Creates an instance of MarketplaceGalleryImageStatus class. + */ public MarketplaceGalleryImageStatus() { } /** * Get the errorCode property: MarketplaceGalleryImage provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -55,7 +58,7 @@ public String errorCode() { /** * Set the errorCode property: MarketplaceGalleryImage provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the MarketplaceGalleryImageStatus object itself. */ @@ -66,7 +69,7 @@ public MarketplaceGalleryImageStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -75,7 +78,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the MarketplaceGalleryImageStatus object itself. */ @@ -86,7 +89,7 @@ public MarketplaceGalleryImageStatus withErrorMessage(String errorMessage) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public MarketplaceGalleryImageStatusProvisioningStatus provisioningStatus() { @@ -95,19 +98,19 @@ public MarketplaceGalleryImageStatusProvisioningStatus 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) { + 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() { @@ -116,19 +119,19 @@ public MarketplaceGalleryImageStatusDownloadStatus 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) { + 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() { @@ -137,7 +140,7 @@ public Long progressPercentage() { /** * Set the progressPercentage property: The progress of the operation in percentage. - * + * * @param progressPercentage the progressPercentage value to set. * @return the MarketplaceGalleryImageStatus object itself. */ @@ -148,7 +151,7 @@ public MarketplaceGalleryImageStatus withProgressPercentage(Long progressPercent /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -159,4 +162,56 @@ public void validate() { 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 index 8c3c82f2506e..9e8584b2fa84 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The download status of the gallery image. + */ @Fluent -public final class MarketplaceGalleryImageStatusDownloadStatus { +public final class MarketplaceGalleryImageStatusDownloadStatus + implements JsonSerializable { /* * The downloaded sized of the image in MB */ - @JsonProperty(value = "downloadSizeInMB") private Long downloadSizeInMB; - /** Creates an instance of MarketplaceGalleryImageStatusDownloadStatus class. */ + /** + * 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() { @@ -31,7 +39,7 @@ public Long 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. */ @@ -42,9 +50,47 @@ public MarketplaceGalleryImageStatusDownloadStatus withDownloadSizeInMB(Long dow /** * 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 index 0fdf25ef0dfb..389380121647 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The MarketplaceGalleryImageStatusProvisioningStatus model. + */ @Fluent -public final class MarketplaceGalleryImageStatusProvisioningStatus { +public final class MarketplaceGalleryImageStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the gallery image */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of MarketplaceGalleryImageStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public MarketplaceGalleryImageStatusProvisioningStatus withOperationId(String op /** * Get the status property: The status of the operation performed on the gallery image [Succeeded, Failed, * InProgress]. - * + * * @return the status value. */ public Status status() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,50 @@ public MarketplaceGalleryImageStatusProvisioningStatus withStatus(Status status) /** * 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 index fe0fa8796d07..c1f672be6b07 100644 --- 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 @@ -10,53 +10,55 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner; import java.util.Map; -/** An immutable client-side representation of MarketplaceGalleryImages. */ +/** + * 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(); @@ -64,14 +66,14 @@ public interface MarketplaceGalleryImages { /** * 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(); @@ -79,21 +81,21 @@ public interface MarketplaceGalleryImages { /** * 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(); @@ -101,72 +103,77 @@ public interface MarketplaceGalleryImages { /** * 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 entirety of the MarketplaceGalleryImages definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The MarketplaceGalleryImages definition stages. */ + /** + * The MarketplaceGalleryImages definition stages. + */ interface DefinitionStages { - /** The first stage of the MarketplaceGalleryImages definition. */ + /** + * The first stage of the MarketplaceGalleryImages definition. + */ interface Blank extends WithLocation { } - /** The stage of the MarketplaceGalleryImages definition allowing to specify location. */ + /** + * 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. */ @@ -174,18 +181,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -196,117 +205,127 @@ interface WithResourceGroup { * 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 { + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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]. + * Azure]. * @return the next definition stage. */ WithCreate withCloudInitDataSource(CloudInitDataSource cloudInitDataSource); } - /** The stage of the MarketplaceGalleryImages definition allowing to specify hyperVGeneration. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -316,36 +335,42 @@ interface WithVersion { /** * Begins update for the MarketplaceGalleryImages resource. - * + * * @return the stage of resource update. */ MarketplaceGalleryImages.Update update(); - /** The template for MarketplaceGalleryImages 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. */ + /** + * The MarketplaceGalleryImages update stages. + */ interface UpdateStages { - /** The stage of the MarketplaceGalleryImages update allowing to specify tags. */ + /** + * 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. */ @@ -355,14 +380,14 @@ interface WithTags { /** * 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. */ 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 index 4d83afc25681..d6e171908462 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The MarketplaceGalleryImagesListResult model. */ +/** + * The MarketplaceGalleryImagesListResult model. + */ @Fluent -public final class MarketplaceGalleryImagesListResult { +public final class MarketplaceGalleryImagesListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of MarketplaceGalleryImagesListResult class. */ + /** + * Creates an instance of MarketplaceGalleryImagesListResult class. + */ public MarketplaceGalleryImagesListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the MarketplaceGalleryImagesListResult object itself. */ @@ -50,7 +56,7 @@ public MarketplaceGalleryImagesListResult withValue(List 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 index 1df407838148..37c6a22dcee7 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of MarketplaceGalleryImagesOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface MarketplaceGalleryImagesOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new MarketplaceGalleryImages resource. - * + * * @param name resource name. * @return the first stage of the new MarketplaceGalleryImages definition. */ 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 index f519104410bb..f12db90c1eb0 100644 --- 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 @@ -5,27 +5,33 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The marketplace gallery image resource patch definition. + */ @Fluent -public final class MarketplaceGalleryImagesUpdateRequest { +public final class MarketplaceGalleryImagesUpdateRequest + implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of MarketplaceGalleryImagesUpdateRequest class. */ + /** + * Creates an instance of MarketplaceGalleryImagesUpdateRequest class. + */ public MarketplaceGalleryImagesUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +40,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the MarketplaceGalleryImagesUpdateRequest object itself. */ @@ -45,9 +51,47 @@ public MarketplaceGalleryImagesUpdateRequest withTags(Map tags) /** * 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/NetworkInterfaceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkInterfaceStatus.java index b4c2e0201454..bfaba89bbdf8 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The observed state of network interfaces. + */ @Fluent -public final class NetworkInterfaceStatus { +public final class NetworkInterfaceStatus implements JsonSerializable { /* * NetworkInterface provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private NetworkInterfaceStatusProvisioningStatus provisioningStatus; - /** Creates an instance of NetworkInterfaceStatus class. */ + /** + * Creates an instance of NetworkInterfaceStatus class. + */ public NetworkInterfaceStatus() { } /** * Get the errorCode property: NetworkInterface provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -43,7 +48,7 @@ public String errorCode() { /** * Set the errorCode property: NetworkInterface provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the NetworkInterfaceStatus object itself. */ @@ -54,7 +59,7 @@ public NetworkInterfaceStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -63,7 +68,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the NetworkInterfaceStatus object itself. */ @@ -74,7 +79,7 @@ public NetworkInterfaceStatus withErrorMessage(String errorMessage) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public NetworkInterfaceStatusProvisioningStatus provisioningStatus() { @@ -83,7 +88,7 @@ public NetworkInterfaceStatusProvisioningStatus provisioningStatus() { /** * Set the provisioningStatus property: The provisioningStatus property. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the NetworkInterfaceStatus object itself. */ @@ -94,7 +99,7 @@ public NetworkInterfaceStatus withProvisioningStatus(NetworkInterfaceStatusProvi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -102,4 +107,47 @@ public void validate() { 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 index 648f20e05eda..f5ec97fee6e6 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The NetworkInterfaceStatusProvisioningStatus model. + */ @Fluent -public final class NetworkInterfaceStatusProvisioningStatus { +public final class NetworkInterfaceStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the network interface */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the network interface [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of NetworkInterfaceStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public NetworkInterfaceStatusProvisioningStatus withOperationId(String operation /** * Get the status property: The status of the operation performed on the network interface [Succeeded, Failed, * InProgress]. - * + * * @return the status value. */ public Status status() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,49 @@ public NetworkInterfaceStatusProvisioningStatus withStatus(Status status) { /** * 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 index 1e464fcbcdab..8360ace87e84 100644 --- 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 @@ -11,139 +11,146 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of NetworkInterfaces. */ +/** + * 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 entirety of the NetworkInterfaces definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The NetworkInterfaces definition stages. */ + /** + * The NetworkInterfaces definition stages. + */ interface DefinitionStages { - /** The first stage of the NetworkInterfaces definition. */ + /** + * The first stage of the NetworkInterfaces definition. + */ interface Blank extends WithLocation { } - /** The stage of the NetworkInterfaces definition allowing to specify location. */ + /** + * 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. */ @@ -151,18 +158,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -173,78 +182,84 @@ interface WithResourceGroup { * 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 { + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -254,36 +269,42 @@ interface WithDnsSettings { /** * Begins update for the NetworkInterfaces resource. - * + * * @return the stage of resource update. */ NetworkInterfaces.Update update(); - /** The template for NetworkInterfaces 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. */ + /** + * The NetworkInterfaces update stages. + */ interface UpdateStages { - /** The stage of the NetworkInterfaces update allowing to specify tags. */ + /** + * 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. */ @@ -293,14 +314,14 @@ interface WithTags { /** * 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. */ 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 index 4493cdeae4d0..a3e4aff3aae3 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The NetworkInterfacesListResult model. */ +/** + * The NetworkInterfacesListResult model. + */ @Fluent -public final class NetworkInterfacesListResult { +public final class NetworkInterfacesListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of NetworkInterfacesListResult class. */ + /** + * Creates an instance of NetworkInterfacesListResult class. + */ public NetworkInterfacesListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the NetworkInterfacesListResult object itself. */ @@ -50,7 +56,7 @@ public NetworkInterfacesListResult withValue(List value) /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The nextLink property. - * + * * @param nextLink the nextLink value to set. * @return the NetworkInterfacesListResult object itself. */ @@ -70,7 +76,7 @@ public NetworkInterfacesListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { 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 index 930366df5ebe..5212ffdb9282 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of NetworkInterfacesOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface NetworkInterfacesOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new NetworkInterfaces resource. - * + * * @param name resource name. * @return the first stage of the new NetworkInterfaces definition. */ 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 index b5370c24c46d..a33bf10a607b 100644 --- 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 @@ -5,27 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The network interface resource patch definition. + */ @Fluent -public final class NetworkInterfacesUpdateRequest { +public final class NetworkInterfacesUpdateRequest implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of NetworkInterfacesUpdateRequest class. */ + /** + * Creates an instance of NetworkInterfacesUpdateRequest class. + */ public NetworkInterfacesUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the NetworkInterfacesUpdateRequest object itself. */ @@ -45,9 +50,47 @@ public NetworkInterfacesUpdateRequest withTags(Map tags) { /** * 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 index 888e4bd5cdc4..06cbafe289c0 100644 --- 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 @@ -5,26 +5,33 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * NetworkProfile - describes the network update configuration the virtual machine instance. + */ @Fluent -public final class NetworkProfileUpdate { +public final class NetworkProfileUpdate implements JsonSerializable { /* * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance */ - @JsonProperty(value = "networkInterfaces") private List networkInterfaces; - /** Creates an instance of NetworkProfileUpdate class. */ + /** + * 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() { @@ -34,19 +41,19 @@ public List 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) { + 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() { @@ -54,4 +61,43 @@ public void validate() { 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 index 7114a92fa8b6..1c8d5b85b59d 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The NetworkProfileUpdateNetworkInterfacesItem model. + */ @Fluent -public final class NetworkProfileUpdateNetworkInterfacesItem { +public final class NetworkProfileUpdateNetworkInterfacesItem + implements JsonSerializable { /* * ID - Resource ID of the network interface */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of NetworkProfileUpdateNetworkInterfacesItem class. */ + /** + * 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() { @@ -31,7 +39,7 @@ public String id() { /** * Set the id property: ID - Resource ID of the network interface. - * + * * @param id the id value to set. * @return the NetworkProfileUpdateNetworkInterfacesItem object itself. */ @@ -42,9 +50,46 @@ public NetworkProfileUpdateNetworkInterfacesItem withId(String id) { /** * 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 new file mode 100644 index 000000000000..13e8a6ba6095 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NicDetail.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights 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; +import java.util.List; + +/** + * The NIC Detail of a device. + */ +@Fluent +public final class NicDetail 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; + + /** + * Creates an instance of NicDetail class. + */ + public NicDetail() { + } + + /** + * Get the adapterName property: Adapter Name of NIC. + * + * @return the adapterName value. + */ + public String adapterName() { + return this.adapterName; + } + + /** + * Set the adapterName property: Adapter Name of NIC. + * + * @param adapterName the adapterName value to set. + * @return the NicDetail object itself. + */ + public NicDetail withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + * Get the interfaceDescription property: Interface Description of NIC. + * + * @return the interfaceDescription value. + */ + public String interfaceDescription() { + return this.interfaceDescription; + } + + /** + * Set the interfaceDescription property: Interface Description of NIC. + * + * @param interfaceDescription the interfaceDescription value to set. + * @return the NicDetail object itself. + */ + public NicDetail withInterfaceDescription(String interfaceDescription) { + this.interfaceDescription = interfaceDescription; + return this; + } + + /** + * Get the componentId property: Component Id of NIC. + * + * @return the componentId value. + */ + public String componentId() { + return this.componentId; + } + + /** + * Set the componentId property: Component Id of NIC. + * + * @param componentId the componentId value to set. + * @return the NicDetail object itself. + */ + public NicDetail withComponentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Get the driverVersion property: Driver Version of NIC. + * + * @return the driverVersion value. + */ + public String driverVersion() { + return this.driverVersion; + } + + /** + * Set the driverVersion property: Driver Version of NIC. + * + * @param driverVersion the driverVersion value to set. + * @return the NicDetail object itself. + */ + public NicDetail withDriverVersion(String driverVersion) { + this.driverVersion = driverVersion; + return this; + } + + /** + * Get the ip4Address property: Subnet Mask of NIC. + * + * @return the ip4Address value. + */ + public String ip4Address() { + return this.ip4Address; + } + + /** + * Set the ip4Address property: Subnet Mask of NIC. + * + * @param ip4Address the ip4Address value to set. + * @return the NicDetail object itself. + */ + public NicDetail withIp4Address(String ip4Address) { + this.ip4Address = ip4Address; + return this; + } + + /** + * Get the subnetMask property: Subnet Mask of NIC. + * + * @return the subnetMask value. + */ + public String subnetMask() { + return this.subnetMask; + } + + /** + * Set the subnetMask property: Subnet Mask of NIC. + * + * @param subnetMask the subnetMask value to set. + * @return the NicDetail object itself. + */ + public NicDetail withSubnetMask(String subnetMask) { + this.subnetMask = subnetMask; + return this; + } + + /** + * Get the defaultGateway property: Default Gateway of NIC. + * + * @return the defaultGateway value. + */ + public String defaultGateway() { + return this.defaultGateway; + } + + /** + * Set the defaultGateway property: Default Gateway of NIC. + * + * @param defaultGateway the defaultGateway value to set. + * @return the NicDetail object itself. + */ + public NicDetail withDefaultGateway(String defaultGateway) { + this.defaultGateway = defaultGateway; + return this; + } + + /** + * Get the dnsServers property: DNS Servers for NIC. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: DNS Servers for NIC. + * + * @param dnsServers the dnsServers value to set. + * @return the NicDetail object itself. + */ + public NicDetail withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the defaultIsolationId property: Default Isolation of Management NIC. + * + * @return the defaultIsolationId value. + */ + public String defaultIsolationId() { + return this.defaultIsolationId; + } + + /** + * Set the defaultIsolationId property: Default Isolation of Management NIC. + * + * @param defaultIsolationId the defaultIsolationId value to set. + * @return the NicDetail object itself. + */ + public NicDetail withDefaultIsolationId(String defaultIsolationId) { + this.defaultIsolationId = defaultIsolationId; + return this; + } + + /** + * Validates the instance. + * + * @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} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adapterName", this.adapterName); + jsonWriter.writeStringField("interfaceDescription", this.interfaceDescription); + jsonWriter.writeStringField("componentId", this.componentId); + jsonWriter.writeStringField("driverVersion", this.driverVersion); + jsonWriter.writeStringField("ip4Address", this.ip4Address); + jsonWriter.writeStringField("subnetMask", this.subnetMask); + jsonWriter.writeStringField("defaultGateway", this.defaultGateway); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("defaultIsolationId", this.defaultIsolationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NicDetail from the JsonReader. + * + * @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 { + return jsonReader.readObject(reader -> { + NicDetail deserializedNicDetail = new NicDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adapterName".equals(fieldName)) { + deserializedNicDetail.adapterName = reader.getString(); + } else if ("interfaceDescription".equals(fieldName)) { + deserializedNicDetail.interfaceDescription = reader.getString(); + } else if ("componentId".equals(fieldName)) { + deserializedNicDetail.componentId = reader.getString(); + } else if ("driverVersion".equals(fieldName)) { + deserializedNicDetail.driverVersion = reader.getString(); + } else if ("ip4Address".equals(fieldName)) { + deserializedNicDetail.ip4Address = reader.getString(); + } else if ("subnetMask".equals(fieldName)) { + deserializedNicDetail.subnetMask = reader.getString(); + } else if ("defaultGateway".equals(fieldName)) { + deserializedNicDetail.defaultGateway = reader.getString(); + } else if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedNicDetail.dnsServers = dnsServers; + } else if ("defaultIsolationId".equals(fieldName)) { + deserializedNicDetail.defaultIsolationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNicDetail; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java new file mode 100644 index 000000000000..a0fd0ad73ab4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of Arc agent in this node. + */ +public final class NodeArcState extends ExpandableStringEnum { + /** + * Static value NotSpecified for NodeArcState. + */ + public static final NodeArcState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Error for NodeArcState. + */ + public static final NodeArcState ERROR = fromString("Error"); + + /** + * Static value Succeeded for NodeArcState. + */ + public static final NodeArcState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for NodeArcState. + */ + public static final NodeArcState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for NodeArcState. + */ + public static final NodeArcState FAILED = fromString("Failed"); + + /** + * Static value Connected for NodeArcState. + */ + public static final NodeArcState CONNECTED = fromString("Connected"); + + /** + * Static value Disconnected for NodeArcState. + */ + public static final NodeArcState DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Deleted for NodeArcState. + */ + public static final NodeArcState DELETED = fromString("Deleted"); + + /** + * Static value Creating for NodeArcState. + */ + public static final NodeArcState CREATING = fromString("Creating"); + + /** + * Static value Updating for NodeArcState. + */ + public static final NodeArcState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for NodeArcState. + */ + public static final NodeArcState DELETING = fromString("Deleting"); + + /** + * Static value Moving for NodeArcState. + */ + public static final NodeArcState MOVING = fromString("Moving"); + + /** + * Static value PartiallySucceeded for NodeArcState. + */ + public static final NodeArcState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** + * Static value PartiallyConnected for NodeArcState. + */ + public static final NodeArcState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value InProgress for NodeArcState. + */ + public static final NodeArcState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Accepted for NodeArcState. + */ + public static final NodeArcState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for NodeArcState. + */ + public static final NodeArcState PROVISIONING = fromString("Provisioning"); + + /** + * Static value DisableInProgress for NodeArcState. + */ + public static final NodeArcState DISABLE_IN_PROGRESS = fromString("DisableInProgress"); + + /** + * Creates a new instance of NodeArcState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeArcState() { + } + + /** + * Creates or finds a NodeArcState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeArcState. + */ + public static NodeArcState fromString(String name) { + return fromString(name, NodeArcState.class); + } + + /** + * Gets known NodeArcState values. + * + * @return known NodeArcState values. + */ + public static Collection values() { + return values(NodeArcState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java new file mode 100644 index 000000000000..56a948d82c2a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of Arc Extension in this node. + */ +public final class NodeExtensionState extends ExpandableStringEnum { + /** + * Static value NotSpecified for NodeExtensionState. + */ + public static final NodeExtensionState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Error for NodeExtensionState. + */ + public static final NodeExtensionState ERROR = fromString("Error"); + + /** + * Static value Succeeded for NodeExtensionState. + */ + public static final NodeExtensionState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for NodeExtensionState. + */ + public static final NodeExtensionState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for NodeExtensionState. + */ + public static final NodeExtensionState FAILED = fromString("Failed"); + + /** + * Static value Connected for NodeExtensionState. + */ + public static final NodeExtensionState CONNECTED = fromString("Connected"); + + /** + * Static value Disconnected for NodeExtensionState. + */ + public static final NodeExtensionState DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Deleted for NodeExtensionState. + */ + public static final NodeExtensionState DELETED = fromString("Deleted"); + + /** + * Static value Creating for NodeExtensionState. + */ + public static final NodeExtensionState CREATING = fromString("Creating"); + + /** + * Static value Updating for NodeExtensionState. + */ + public static final NodeExtensionState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for NodeExtensionState. + */ + public static final NodeExtensionState DELETING = fromString("Deleting"); + + /** + * Static value Moving for NodeExtensionState. + */ + public static final NodeExtensionState MOVING = fromString("Moving"); + + /** + * Static value PartiallySucceeded for NodeExtensionState. + */ + public static final NodeExtensionState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** + * Static value PartiallyConnected for NodeExtensionState. + */ + public static final NodeExtensionState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value InProgress for NodeExtensionState. + */ + public static final NodeExtensionState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Accepted for NodeExtensionState. + */ + public static final NodeExtensionState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for NodeExtensionState. + */ + public static final NodeExtensionState PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of NodeExtensionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeExtensionState() { + } + + /** + * Creates or finds a NodeExtensionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeExtensionState. + */ + public static NodeExtensionState fromString(String name) { + return fromString(name, NodeExtensionState.class); + } + + /** + * Gets known NodeExtensionState values. + * + * @return known NodeExtensionState values. + */ + public static Collection values() { + return values(NodeExtensionState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Observability.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Observability.java new file mode 100644 index 000000000000..55e320fb2745 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Observability.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Observability of AzureStackHCI Cluster. + */ +@Fluent +public final class Observability implements JsonSerializable { + /* + * Enables telemetry data to be sent to Microsoft + */ + private Boolean streamingDataClient; + + /* + * Location of your cluster. The log and diagnostic data is sent to the appropriate diagnostics servers depending + * upon where your cluster resides. Setting this to false results in all data sent to Microsoft to be stored outside + * of the EU. + */ + private Boolean euLocation; + + /* + * When set to true, collects log data to facilitate quicker issue resolution. + */ + private Boolean episodicDataUpload; + + /** + * Creates an instance of Observability class. + */ + public Observability() { + } + + /** + * Get the streamingDataClient property: Enables telemetry data to be sent to Microsoft. + * + * @return the streamingDataClient value. + */ + public Boolean streamingDataClient() { + return this.streamingDataClient; + } + + /** + * Set the streamingDataClient property: Enables telemetry data to be sent to Microsoft. + * + * @param streamingDataClient the streamingDataClient value to set. + * @return the Observability object itself. + */ + public Observability withStreamingDataClient(Boolean streamingDataClient) { + this.streamingDataClient = streamingDataClient; + return this; + } + + /** + * Get the euLocation property: Location of your cluster. The log and diagnostic data is sent to the appropriate + * diagnostics servers depending upon where your cluster resides. Setting this to false results in all data sent to + * Microsoft to be stored outside of the EU. + * + * @return the euLocation value. + */ + public Boolean euLocation() { + return this.euLocation; + } + + /** + * Set the euLocation property: Location of your cluster. The log and diagnostic data is sent to the appropriate + * diagnostics servers depending upon where your cluster resides. Setting this to false results in all data sent to + * Microsoft to be stored outside of the EU. + * + * @param euLocation the euLocation value to set. + * @return the Observability object itself. + */ + public Observability withEuLocation(Boolean euLocation) { + this.euLocation = euLocation; + return this; + } + + /** + * Get the episodicDataUpload property: When set to true, collects log data to facilitate quicker issue resolution. + * + * @return the episodicDataUpload value. + */ + public Boolean episodicDataUpload() { + return this.episodicDataUpload; + } + + /** + * Set the episodicDataUpload property: When set to true, collects log data to facilitate quicker issue resolution. + * + * @param episodicDataUpload the episodicDataUpload value to set. + * @return the Observability object itself. + */ + public Observability withEpisodicDataUpload(Boolean episodicDataUpload) { + this.episodicDataUpload = episodicDataUpload; + 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("streamingDataClient", this.streamingDataClient); + jsonWriter.writeBooleanField("euLocation", this.euLocation); + jsonWriter.writeBooleanField("episodicDataUpload", this.episodicDataUpload); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Observability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Observability 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 Observability. + */ + public static Observability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Observability deserializedObservability = new Observability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streamingDataClient".equals(fieldName)) { + deserializedObservability.streamingDataClient = reader.getNullable(JsonReader::getBoolean); + } else if ("euLocation".equals(fieldName)) { + deserializedObservability.euLocation = reader.getNullable(JsonReader::getBoolean); + } else if ("episodicDataUpload".equals(fieldName)) { + deserializedObservability.episodicDataUpload = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedObservability; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OemActivation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OemActivation.java new file mode 100644 index 000000000000..2212846f9ce2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OemActivation.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; + +/** + * OEM activation status of the cluster. + */ +public final class OemActivation extends ExpandableStringEnum { + /** + * Static value Disabled for OemActivation. + */ + public static final OemActivation DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for OemActivation. + */ + public static final OemActivation ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of OemActivation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OemActivation() { + } + + /** + * Creates or finds a OemActivation from its string representation. + * + * @param name a name to look for. + * @return the corresponding OemActivation. + */ + public static OemActivation fromString(String name) { + return fromString(name, OemActivation.class); + } + + /** + * Gets known OemActivation values. + * + * @return known OemActivation values. + */ + public static Collection values() { + return values(OemActivation.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java new file mode 100644 index 000000000000..7ff6efbab5bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import java.util.List; + +/** + * An immutable client-side representation of Offer. + */ +public interface Offer { + /** + * 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 provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + String publisherId(); + + /** + * Gets the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + String content(); + + /** + * Gets the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + List skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner object. + * + * @return the inner object. + */ + OfferInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java new file mode 100644 index 000000000000..e235947e6460 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.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.Immutable; +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.OfferInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Offer proxy resources for the HCI cluster. + */ +@Immutable +public final class OfferList implements JsonSerializable { + /* + * List of Offer proxy resources. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of OfferList class. + */ + public OfferList() { + } + + /** + * Get the value property: List of Offer proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfferList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfferList 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 OfferList. + */ + public static OfferList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfferList deserializedOfferList = new OfferList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OfferInner.fromJson(reader1)); + deserializedOfferList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOfferList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOfferList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java new file mode 100644 index 000000000000..5e90dee67f55 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Offers. + */ +public interface Offers { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName, + String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + String offerName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} 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 index 8514fa16699f..df7868d01653 100644 --- 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 @@ -4,18 +4,23 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Operating system type that the gallery image uses [Windows, Linux]. */ +/** + * Operating system type that the gallery image uses [Windows, Linux]. + */ public enum OperatingSystemTypes { - /** Enum value Windows. */ + /** + * Enum value Windows. + */ WINDOWS("Windows"), - /** Enum value Linux. */ + /** + * Enum value Linux. + */ LINUX("Linux"); - /** The actual serialized value for a OperatingSystemTypes instance. */ + /** + * The actual serialized value for a OperatingSystemTypes instance. + */ private final String value; OperatingSystemTypes(String value) { @@ -24,11 +29,10 @@ public enum OperatingSystemTypes { /** * Parses a serialized value to a OperatingSystemTypes instance. - * + * * @param value the serialized value to parse. * @return the parsed OperatingSystemTypes object, or null if unable to parse. */ - @JsonCreator public static OperatingSystemTypes fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static OperatingSystemTypes fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java index 6f019b09ee2c..a0be8072f0aa 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java @@ -4,53 +4,166 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; +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; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class Operation implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of Operation class. + */ + public Operation() { + } -/** An immutable client-side representation of Operation. */ -public interface Operation { /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ - String name(); + public String name() { + return this.name; + } /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ - Boolean isDataAction(); + public Boolean isDataAction() { + return this.isDataAction; + } /** - * Gets the display property: Localized display information for this particular operation. - * + * Get the display property: Localized display information for this particular operation. + * * @return the display value. */ - OperationDisplay display(); + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the Operation object itself. + */ + public Operation withDisplay(OperationDisplay display) { + this.display = display; + return this; + } /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ - Origin origin(); + public Origin origin() { + return this.origin; + } /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ - ActionType actionType(); + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner object. - * - * @return the inner object. + * Reads an instance of Operation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Operation 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 Operation. */ - OperationInner innerModel(); + public static Operation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Operation deserializedOperation = new Operation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperation.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperation.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperation.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperation.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperation.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperation; + }); + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java index 2d240728b7e4..0da364a94c1b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,9 +87,50 @@ public String description() { /** * 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 OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java index 3f4e7b24e1f6..378e27c91296 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java @@ -4,59 +4,31 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. + * An immutable client-side representation of OperationListResult. */ -@Immutable -public final class OperationListResult { - /* - * List of operations supported by the resource provider - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of OperationListResult class. */ - public OperationListResult() { - } - +public interface OperationListResult { /** - * Get the value property: List of operations supported by the resource provider. - * + * Gets the value property: List of operations supported by the resource provider. + * * @return the value value. */ - public List value() { - return this.value; - } + List value(); /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * Gets the nextLink property: URL to get the next set of operation list results (if there are any). + * * @return the nextLink value. */ - public String nextLink() { - return this.nextLink; - } + String nextLink(); /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner object. + * + * @return the inner object. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } + OperationListResultInner innerModel(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java index 79d9ebf8b0cd..5ee0ff63bb53 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java @@ -4,30 +4,30 @@ 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 Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** - * List all the supported operations. - * + * List all available Microsoft.AzureStackHCI provider operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - PagedIterable list(); + Response listWithResponse(Context context); /** - * List all the supported operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List all available Microsoft.AzureStackHCI provider operations. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - PagedIterable list(Context context); + OperationListResult list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OptionalServices.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OptionalServices.java new file mode 100644 index 000000000000..001560cc7410 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OptionalServices.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights 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 OptionalServices of AzureStackHCI Cluster. + */ +@Fluent +public final class OptionalServices implements JsonSerializable { + /* + * The name of custom location. + */ + private String customLocation; + + /** + * Creates an instance of OptionalServices class. + */ + public OptionalServices() { + } + + /** + * Get the customLocation property: The name of custom location. + * + * @return the customLocation value. + */ + public String customLocation() { + return this.customLocation; + } + + /** + * Set the customLocation property: The name of custom location. + * + * @param customLocation the customLocation value to set. + * @return the OptionalServices object itself. + */ + public OptionalServices withCustomLocation(String customLocation) { + this.customLocation = customLocation; + 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("customLocation", this.customLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptionalServices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptionalServices 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 OptionalServices. + */ + public static OptionalServices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptionalServices deserializedOptionalServices = new OptionalServices(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customLocation".equals(fieldName)) { + deserializedOptionalServices.customLocation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOptionalServices; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java index d45e549be2fa..9bf1d9951e44 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { 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 index 92be1b0c560d..3e4e83a23121 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * OsProfile - describes the update configuration of the operating system. + */ @Fluent -public final class OsProfileUpdate { +public final class OsProfileUpdate implements JsonSerializable { /* * ComputerName - name of the computer */ - @JsonProperty(value = "computerName") private String computerName; /* * The linuxConfiguration property. */ - @JsonProperty(value = "linuxConfiguration") private OsProfileUpdateLinuxConfiguration linuxConfiguration; /* * The windowsConfiguration property. */ - @JsonProperty(value = "windowsConfiguration") private OsProfileUpdateWindowsConfiguration windowsConfiguration; - /** Creates an instance of OsProfileUpdate class. */ + /** + * Creates an instance of OsProfileUpdate class. + */ public OsProfileUpdate() { } /** * Get the computerName property: ComputerName - name of the computer. - * + * * @return the computerName value. */ public String computerName() { @@ -43,7 +48,7 @@ public String computerName() { /** * Set the computerName property: ComputerName - name of the computer. - * + * * @param computerName the computerName value to set. * @return the OsProfileUpdate object itself. */ @@ -54,7 +59,7 @@ public OsProfileUpdate withComputerName(String computerName) { /** * Get the linuxConfiguration property: The linuxConfiguration property. - * + * * @return the linuxConfiguration value. */ public OsProfileUpdateLinuxConfiguration linuxConfiguration() { @@ -63,7 +68,7 @@ public OsProfileUpdateLinuxConfiguration linuxConfiguration() { /** * Set the linuxConfiguration property: The linuxConfiguration property. - * + * * @param linuxConfiguration the linuxConfiguration value to set. * @return the OsProfileUpdate object itself. */ @@ -74,7 +79,7 @@ public OsProfileUpdate withLinuxConfiguration(OsProfileUpdateLinuxConfiguration /** * Get the windowsConfiguration property: The windowsConfiguration property. - * + * * @return the windowsConfiguration value. */ public OsProfileUpdateWindowsConfiguration windowsConfiguration() { @@ -83,7 +88,7 @@ public OsProfileUpdateWindowsConfiguration windowsConfiguration() { /** * Set the windowsConfiguration property: The windowsConfiguration property. - * + * * @param windowsConfiguration the windowsConfiguration value to set. * @return the OsProfileUpdate object itself. */ @@ -94,7 +99,7 @@ public OsProfileUpdate withWindowsConfiguration(OsProfileUpdateWindowsConfigurat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -105,4 +110,47 @@ public void validate() { 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 index 5f14bd85973b..3cb431e67d3b 100644 --- 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 @@ -5,32 +5,38 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The OsProfileUpdateLinuxConfiguration model. + */ @Fluent -public final class OsProfileUpdateLinuxConfiguration { +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. + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. */ - @JsonProperty(value = "provisionVMAgent") private Boolean provisionVMAgent; /* * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ - @JsonProperty(value = "provisionVMConfigAgent") private Boolean provisionVMConfigAgent; - /** Creates an instance of OsProfileUpdateLinuxConfiguration class. */ + /** + * 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() { @@ -40,7 +46,7 @@ public Boolean 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. */ @@ -52,7 +58,7 @@ public OsProfileUpdateLinuxConfiguration withProvisionVMAgent(Boolean provisionV /** * 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() { @@ -62,7 +68,7 @@ public Boolean 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. */ @@ -73,9 +79,51 @@ public OsProfileUpdateLinuxConfiguration withProvisionVMConfigAgent(Boolean prov /** * 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 index 10167da39c0a..73bd842e10d0 100644 --- 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 @@ -5,32 +5,39 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The OsProfileUpdateWindowsConfiguration model. + */ @Fluent -public final class OsProfileUpdateWindowsConfiguration { +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. + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. */ - @JsonProperty(value = "provisionVMAgent") private Boolean provisionVMAgent; /* * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ - @JsonProperty(value = "provisionVMConfigAgent") private Boolean provisionVMConfigAgent; - /** Creates an instance of OsProfileUpdateWindowsConfiguration class. */ + /** + * 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() { @@ -40,7 +47,7 @@ public Boolean 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. */ @@ -52,7 +59,7 @@ public OsProfileUpdateWindowsConfiguration withProvisionVMAgent(Boolean provisio /** * 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() { @@ -62,7 +69,7 @@ public Boolean 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. */ @@ -73,9 +80,51 @@ public OsProfileUpdateWindowsConfiguration withProvisionVMConfigAgent(Boolean pr /** * 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/PackageVersionInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java new file mode 100644 index 000000000000..79553c30a669 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Current version of each updatable component. + */ +@Fluent +public final class PackageVersionInfo implements JsonSerializable { + /* + * Package type + */ + private String packageType; + + /* + * Package version + */ + private String version; + + /* + * Last time this component was updated. + */ + private OffsetDateTime lastUpdated; + + /** + * Creates an instance of PackageVersionInfo class. + */ + public PackageVersionInfo() { + } + + /** + * Get the packageType property: Package type. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Package type. + * + * @param packageType the packageType value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the version property: Package version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Package version. + * + * @param version the version value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the lastUpdated property: Last time this component was updated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time this component was updated. + * + * @param lastUpdated the lastUpdated value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + 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("packageType", this.packageType); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("lastUpdated", + this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PackageVersionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PackageVersionInfo 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 PackageVersionInfo. + */ + public static PackageVersionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PackageVersionInfo deserializedPackageVersionInfo = new PackageVersionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("packageType".equals(fieldName)) { + deserializedPackageVersionInfo.packageType = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedPackageVersionInfo.version = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedPackageVersionInfo.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPackageVersionInfo; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java new file mode 100644 index 000000000000..a148be1e3cc8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of PasswordCredential. + */ +public interface PasswordCredential { + /** + * Gets the secretText property: The secretText property. + * + * @return the secretText value. + */ + String secretText(); + + /** + * Gets the keyId property: The keyId property. + * + * @return the keyId value. + */ + String keyId(); + + /** + * Gets the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner object. + * + * @return the inner object. + */ + PasswordCredentialInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java new file mode 100644 index 000000000000..e6ca5d9c40a7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * Status of Arc Extension for a particular node in HCI Cluster. + */ +@Immutable +public final class PerNodeExtensionState implements JsonSerializable { + /* + * Name of the node in HCI Cluster. + */ + private String name; + + /* + * Fully qualified resource ID for the particular Arc Extension on this node. + */ + private String extension; + + /* + * Specifies the version of the script handler. + */ + private String typeHandlerVersion; + + /* + * State of Arc Extension in this node. + */ + private NodeExtensionState state; + + /* + * The extension instance view. + */ + private ExtensionInstanceView instanceView; + + /** + * Creates an instance of PerNodeExtensionState class. + */ + public PerNodeExtensionState() { + } + + /** + * Get the name property: Name of the node in HCI Cluster. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the extension property: Fully qualified resource ID for the particular Arc Extension on this node. + * + * @return the extension value. + */ + public String extension() { + return this.extension; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Get the state property: State of Arc Extension in this node. + * + * @return the state value. + */ + public NodeExtensionState state() { + return this.state; + } + + /** + * Get the instanceView property: The extension instance view. + * + * @return the instanceView value. + */ + public ExtensionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceView() != null) { + instanceView().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PerNodeExtensionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PerNodeExtensionState 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 PerNodeExtensionState. + */ + public static PerNodeExtensionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PerNodeExtensionState deserializedPerNodeExtensionState = new PerNodeExtensionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPerNodeExtensionState.name = reader.getString(); + } else if ("extension".equals(fieldName)) { + deserializedPerNodeExtensionState.extension = reader.getString(); + } else if ("typeHandlerVersion".equals(fieldName)) { + deserializedPerNodeExtensionState.typeHandlerVersion = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedPerNodeExtensionState.state = NodeExtensionState.fromString(reader.getString()); + } else if ("instanceView".equals(fieldName)) { + deserializedPerNodeExtensionState.instanceView = ExtensionInstanceView.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPerNodeExtensionState; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java new file mode 100644 index 000000000000..f0da3fd98dbc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.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.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; + +/** + * Status of Arc agent for a particular node in HCI Cluster. + */ +@Immutable +public final class PerNodeState implements JsonSerializable { + /* + * Name of the Node in HCI Cluster + */ + private String name; + + /* + * Fully qualified resource ID for the Arc agent of this node. + */ + private String arcInstance; + + /* + * The service principal id of the arc for server node + */ + private String arcNodeServicePrincipalObjectId; + + /* + * State of Arc agent in this node. + */ + private NodeArcState state; + + /** + * Creates an instance of PerNodeState class. + */ + public PerNodeState() { + } + + /** + * Get the name property: Name of the Node in HCI Cluster. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the arcInstance property: Fully qualified resource ID for the Arc agent of this node. + * + * @return the arcInstance value. + */ + public String arcInstance() { + return this.arcInstance; + } + + /** + * Get the arcNodeServicePrincipalObjectId property: The service principal id of the arc for server node. + * + * @return the arcNodeServicePrincipalObjectId value. + */ + public String arcNodeServicePrincipalObjectId() { + return this.arcNodeServicePrincipalObjectId; + } + + /** + * Get the state property: State of Arc agent in this node. + * + * @return the state value. + */ + public NodeArcState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PerNodeState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PerNodeState 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 PerNodeState. + */ + public static PerNodeState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PerNodeState deserializedPerNodeState = new PerNodeState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPerNodeState.name = reader.getString(); + } else if ("arcInstance".equals(fieldName)) { + deserializedPerNodeState.arcInstance = reader.getString(); + } else if ("arcNodeServicePrincipalObjectId".equals(fieldName)) { + deserializedPerNodeState.arcNodeServicePrincipalObjectId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedPerNodeState.state = NodeArcState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPerNodeState; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PhysicalNodes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PhysicalNodes.java new file mode 100644 index 000000000000..2e66cf730b73 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PhysicalNodes.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; + +/** + * The PhysicalNodes of a cluster. + */ +@Fluent +public final class PhysicalNodes implements JsonSerializable { + /* + * NETBIOS name of each physical server on your Azure Stack HCI cluster. + */ + private String name; + + /* + * The IPv4 address assigned to each physical server on your Azure Stack HCI cluster. + */ + private String ipv4Address; + + /** + * Creates an instance of PhysicalNodes class. + */ + public PhysicalNodes() { + } + + /** + * Get the name property: NETBIOS name of each physical server on your Azure Stack HCI cluster. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: NETBIOS name of each physical server on your Azure Stack HCI cluster. + * + * @param name the name value to set. + * @return the PhysicalNodes object itself. + */ + public PhysicalNodes withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ipv4Address property: The IPv4 address assigned to each physical server 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 physical server on your Azure Stack HCI cluster. + * + * @param ipv4Address the ipv4Address value to set. + * @return the PhysicalNodes object itself. + */ + public PhysicalNodes withIpv4Address(String ipv4Address) { + this.ipv4Address = ipv4Address; + 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("name", this.name); + jsonWriter.writeStringField("ipv4Address", this.ipv4Address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalNodes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalNodes 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 PhysicalNodes. + */ + public static PhysicalNodes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalNodes deserializedPhysicalNodes = new PhysicalNodes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPhysicalNodes.name = reader.getString(); + } else if ("ipv4Address".equals(fieldName)) { + deserializedPhysicalNodes.ipv4Address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalNodes; + }); + } +} 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 index 7691d9454c9e..e340e62d7844 100644 --- 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 @@ -5,35 +5,50 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The power state of the virtual machine instance. */ +/** + * The power state of the virtual machine instance. + */ public final class PowerStateEnum extends ExpandableStringEnum { - /** Static value Deallocated for PowerStateEnum. */ + /** + * Static value Deallocated for PowerStateEnum. + */ public static final PowerStateEnum DEALLOCATED = fromString("Deallocated"); - /** Static value Deallocating for PowerStateEnum. */ + /** + * Static value Deallocating for PowerStateEnum. + */ public static final PowerStateEnum DEALLOCATING = fromString("Deallocating"); - /** Static value Running for PowerStateEnum. */ + /** + * Static value Running for PowerStateEnum. + */ public static final PowerStateEnum RUNNING = fromString("Running"); - /** Static value Starting for PowerStateEnum. */ + /** + * Static value Starting for PowerStateEnum. + */ public static final PowerStateEnum STARTING = fromString("Starting"); - /** Static value Stopped for PowerStateEnum. */ + /** + * Static value Stopped for PowerStateEnum. + */ public static final PowerStateEnum STOPPED = fromString("Stopped"); - /** Static value Stopping for PowerStateEnum. */ + /** + * Static value Stopping for PowerStateEnum. + */ public static final PowerStateEnum STOPPING = fromString("Stopping"); - /** Static value Unknown for PowerStateEnum. */ + /** + * 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 @@ -42,18 +57,17 @@ public PowerStateEnum() { /** * Creates or finds a PowerStateEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding PowerStateEnum. */ - @JsonCreator public static PowerStateEnum fromString(String name) { return fromString(name, PowerStateEnum.class); } /** * Gets known PowerStateEnum values. - * + * * @return known PowerStateEnum values. */ public static Collection values() { 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 new file mode 100644 index 000000000000..3a0cae43cca6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** + * The PrecheckResult model. + */ +@Fluent +public final class PrecheckResult implements JsonSerializable { + /* + * Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. + */ + private String name; + + /* + * The health check DisplayName localized of the individual test executed. + */ + private String displayName; + + /* + * Key-value pairs that allow grouping/filtering individual tests. + */ + private PrecheckResultTags tags; + + /* + * User-facing name; one or more sentences indicating the direct issue. + */ + private String title; + + /* + * The status of the check running (i.e. Failed, Succeeded, In Progress). This answers whether the check ran, and + * passed or failed. + */ + private Status status; + + /* + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. + * Critical is the only update-blocking severity. + */ + private Severity severity; + + /* + * Detailed overview of the issue and what impact the issue has on the stamp. + */ + private String description; + + /* + * Set of steps that can be taken to resolve the issue found. + */ + private String remediation; + + /* + * The unique identifier for the affected resource (such as a node or drive). + */ + private String targetResourceId; + + /* + * The name of the affected resource. + */ + private String targetResourceName; + + /* + * The Time in which the HealthCheck was called. + */ + private OffsetDateTime timestamp; + + /* + * Property bag of key value pairs for additional information. + */ + private String additionalData; + + /* + * The name of the services called for the HealthCheck (I.E. Test-AzureStack, Test-Cluster). + */ + private String healthCheckSource; + + /** + * Creates an instance of PrecheckResult class. + */ + public PrecheckResult() { + } + + /** + * Get the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @param name the name value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The health check DisplayName localized of the individual test executed. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The health check DisplayName localized of the individual test executed. + * + * @param displayName the displayName value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @return the tags value. + */ + public PrecheckResultTags tags() { + return this.tags; + } + + /** + * Set the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @param tags the tags value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTags(PrecheckResultTags tags) { + this.tags = tags; + return this; + } + + /** + * Get the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @param title the title value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @param status the status value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @param severity the severity value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @param description the description value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @return the remediation value. + */ + public String remediation() { + return this.remediation; + } + + /** + * Set the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @param remediation the remediation value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withRemediation(String remediation) { + this.remediation = remediation; + return this; + } + + /** + * Get the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @param targetResourceId the targetResourceId value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the targetResourceName property: The name of the affected resource. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.targetResourceName; + } + + /** + * Set the targetResourceName property: The name of the affected resource. + * + * @param targetResourceName the targetResourceName value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceName(String targetResourceName) { + this.targetResourceName = targetResourceName; + return this; + } + + /** + * Get the timestamp property: The Time in which the HealthCheck was called. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The Time in which the HealthCheck was called. + * + * @param timestamp the timestamp value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the additionalData property: Property bag of key value pairs for additional information. + * + * @return the additionalData value. + */ + public String additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: Property bag of key value pairs for additional information. + * + * @param additionalData the additionalData value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withAdditionalData(String additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @return the healthCheckSource value. + */ + public String healthCheckSource() { + return this.healthCheckSource; + } + + /** + * Set the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @param healthCheckSource the healthCheckSource value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withHealthCheckSource(String healthCheckSource) { + this.healthCheckSource = healthCheckSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("tags", this.tags); + 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()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("remediation", this.remediation); + jsonWriter.writeStringField("targetResourceID", this.targetResourceId); + jsonWriter.writeStringField("targetResourceName", this.targetResourceName); + jsonWriter.writeStringField("timestamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + jsonWriter.writeStringField("additionalData", this.additionalData); + jsonWriter.writeStringField("healthCheckSource", this.healthCheckSource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrecheckResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrecheckResult 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 PrecheckResult. + */ + public static PrecheckResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrecheckResult deserializedPrecheckResult = new PrecheckResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPrecheckResult.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedPrecheckResult.displayName = reader.getString(); + } else if ("tags".equals(fieldName)) { + deserializedPrecheckResult.tags = PrecheckResultTags.fromJson(reader); + } else if ("title".equals(fieldName)) { + deserializedPrecheckResult.title = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedPrecheckResult.status = Status.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedPrecheckResult.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrecheckResult.description = reader.getString(); + } else if ("remediation".equals(fieldName)) { + deserializedPrecheckResult.remediation = reader.getString(); + } else if ("targetResourceID".equals(fieldName)) { + deserializedPrecheckResult.targetResourceId = reader.getString(); + } else if ("targetResourceName".equals(fieldName)) { + deserializedPrecheckResult.targetResourceName = reader.getString(); + } else if ("timestamp".equals(fieldName)) { + deserializedPrecheckResult.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("additionalData".equals(fieldName)) { + deserializedPrecheckResult.additionalData = reader.getString(); + } else if ("healthCheckSource".equals(fieldName)) { + deserializedPrecheckResult.healthCheckSource = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrecheckResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java new file mode 100644 index 000000000000..0ec61ccc58fe --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.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; + +/** + * Key-value pairs that allow grouping/filtering individual tests. + */ +@Fluent +public final class PrecheckResultTags implements JsonSerializable { + /* + * Key that allow grouping/filtering individual tests. + */ + private String key; + + /* + * Value of the key that allow grouping/filtering individual tests. + */ + private String value; + + /** + * Creates an instance of PrecheckResultTags class. + */ + public PrecheckResultTags() { + } + + /** + * Get the key property: Key that allow grouping/filtering individual tests. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Key that allow grouping/filtering individual tests. + * + * @param key the key value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Value of the key that allow grouping/filtering individual tests. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the key that allow grouping/filtering individual tests. + * + * @param value the value value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withValue(String value) { + this.value = value; + 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("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrecheckResultTags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrecheckResultTags 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 PrecheckResultTags. + */ + public static PrecheckResultTags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrecheckResultTags deserializedPrecheckResultTags = new PrecheckResultTags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedPrecheckResultTags.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedPrecheckResultTags.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrecheckResultTags; + }); + } +} 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 index 9c8b56e4f67c..9e2f67139289 100644 --- 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 @@ -5,23 +5,30 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the different types of operations for guest agent. */ +/** + * Defines the different types of operations for guest agent. + */ public final class ProvisioningAction extends ExpandableStringEnum { - /** Static value install for ProvisioningAction. */ + /** + * Static value install for ProvisioningAction. + */ public static final ProvisioningAction INSTALL = fromString("install"); - /** Static value uninstall for ProvisioningAction. */ + /** + * Static value uninstall for ProvisioningAction. + */ public static final ProvisioningAction UNINSTALL = fromString("uninstall"); - /** Static value repair for ProvisioningAction. */ + /** + * 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 @@ -30,18 +37,17 @@ public ProvisioningAction() { /** * Creates or finds a ProvisioningAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningAction. */ - @JsonCreator public static ProvisioningAction fromString(String name) { return fromString(name, ProvisioningAction.class); } /** * Gets known ProvisioningAction values. - * + * * @return known ProvisioningAction values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java new file mode 100644 index 000000000000..2f0e58f7b039 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the ArcSetting proxy resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value NotSpecified for ProvisioningState. + */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Error for ProvisioningState. + */ + public static final ProvisioningState ERROR = fromString("Error"); + + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Connected for ProvisioningState. + */ + public static final ProvisioningState CONNECTED = fromString("Connected"); + + /** + * Static value Disconnected for ProvisioningState. + */ + public static final ProvisioningState DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Deleted for ProvisioningState. + */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Moving for ProvisioningState. + */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * Static value PartiallySucceeded for ProvisioningState. + */ + public static final ProvisioningState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** + * Static value PartiallyConnected for ProvisioningState. + */ + public static final ProvisioningState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** + * Static value InProgress for ProvisioningState. + */ + public static final ProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value DisableInProgress for ProvisioningState. + */ + public static final ProvisioningState DISABLE_IN_PROGRESS = fromString("DisableInProgress"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningStateEnum.java index 8216560bfdd9..60fe4de7b541 100644 --- 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 @@ -5,32 +5,45 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provisioning state of the gallery image. */ +/** + * Provisioning state of the gallery image. + */ public final class ProvisioningStateEnum extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningStateEnum. */ + /** + * Static value Succeeded for ProvisioningStateEnum. + */ public static final ProvisioningStateEnum SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningStateEnum. */ + /** + * Static value Failed for ProvisioningStateEnum. + */ public static final ProvisioningStateEnum FAILED = fromString("Failed"); - /** Static value InProgress for ProvisioningStateEnum. */ + /** + * Static value InProgress for ProvisioningStateEnum. + */ public static final ProvisioningStateEnum IN_PROGRESS = fromString("InProgress"); - /** Static value Accepted for ProvisioningStateEnum. */ + /** + * Static value Accepted for ProvisioningStateEnum. + */ public static final ProvisioningStateEnum ACCEPTED = fromString("Accepted"); - /** Static value Deleting for ProvisioningStateEnum. */ + /** + * Static value Deleting for ProvisioningStateEnum. + */ public static final ProvisioningStateEnum DELETING = fromString("Deleting"); - /** Static value Canceled for ProvisioningStateEnum. */ + /** + * 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 @@ -39,18 +52,17 @@ public ProvisioningStateEnum() { /** * Creates or finds a ProvisioningStateEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningStateEnum. */ - @JsonCreator public static ProvisioningStateEnum fromString(String name) { return fromString(name, ProvisioningStateEnum.class); } /** * Gets known ProvisioningStateEnum values. - * + * * @return known ProvisioningStateEnum values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java new file mode 100644 index 000000000000..89707328f490 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; + +/** + * An immutable client-side representation of Publisher. + */ +public interface Publisher { + /** + * 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 provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner object. + * + * @return the inner object. + */ + PublisherInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.java new file mode 100644 index 000000000000..ab1f70e8d201 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.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.Immutable; +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.PublisherInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Publisher proxy resources for the HCI cluster. + */ +@Immutable +public final class PublisherList implements JsonSerializable { + /* + * List of Publisher proxy resources. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PublisherList class. + */ + public PublisherList() { + } + + /** + * Get the value property: List of Publisher proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublisherList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublisherList 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 PublisherList. + */ + public static PublisherList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublisherList deserializedPublisherList = new PublisherList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> PublisherInner.fromJson(reader1)); + deserializedPublisherList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPublisherList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublisherList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java new file mode 100644 index 000000000000..e948fc8e2997 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 Publishers. + */ +public interface Publishers { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, + Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + Publisher get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/QosPolicyOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/QosPolicyOverrides.java new file mode 100644 index 000000000000..015d4914555e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/QosPolicyOverrides.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 java.io.IOException; + +/** + * The QoSPolicyOverrides of a cluster. + */ +@Fluent +public final class QosPolicyOverrides implements JsonSerializable { + /* + * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM + * validation. + */ + private String priorityValue8021ActionCluster; + + /* + * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM + * validation. + */ + private String priorityValue8021ActionSmb; + + /* + * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM + * validation. + */ + private String bandwidthPercentageSmb; + + /** + * Creates an instance of QosPolicyOverrides class. + */ + public QosPolicyOverrides() { + } + + /** + * Get the priorityValue8021ActionCluster property: This parameter should only be modified based on your OEM + * guidance. Do not modify this parameter without OEM validation. + * + * @return the priorityValue8021ActionCluster value. + */ + public String priorityValue8021ActionCluster() { + return this.priorityValue8021ActionCluster; + } + + /** + * Set the priorityValue8021ActionCluster property: This parameter should only be modified based on your OEM + * guidance. Do not modify this parameter without OEM validation. + * + * @param priorityValue8021ActionCluster the priorityValue8021ActionCluster value to set. + * @return the QosPolicyOverrides object itself. + */ + public QosPolicyOverrides withPriorityValue8021ActionCluster(String priorityValue8021ActionCluster) { + this.priorityValue8021ActionCluster = priorityValue8021ActionCluster; + return this; + } + + /** + * Get the priorityValue8021ActionSmb property: This parameter should only be modified based on your OEM guidance. + * Do not modify this parameter without OEM validation. + * + * @return the priorityValue8021ActionSmb value. + */ + public String priorityValue8021ActionSmb() { + return this.priorityValue8021ActionSmb; + } + + /** + * Set the priorityValue8021ActionSmb property: This parameter should only be modified based on your OEM guidance. + * Do not modify this parameter without OEM validation. + * + * @param priorityValue8021ActionSmb the priorityValue8021ActionSmb value to set. + * @return the QosPolicyOverrides object itself. + */ + public QosPolicyOverrides withPriorityValue8021ActionSmb(String priorityValue8021ActionSmb) { + this.priorityValue8021ActionSmb = priorityValue8021ActionSmb; + return this; + } + + /** + * Get the bandwidthPercentageSmb property: This parameter should only be modified based on your OEM guidance. Do + * not modify this parameter without OEM validation. + * + * @return the bandwidthPercentageSmb value. + */ + public String bandwidthPercentageSmb() { + return this.bandwidthPercentageSmb; + } + + /** + * Set the bandwidthPercentageSmb property: This parameter should only be modified based on your OEM guidance. Do + * not modify this parameter without OEM validation. + * + * @param bandwidthPercentageSmb the bandwidthPercentageSmb value to set. + * @return the QosPolicyOverrides object itself. + */ + public QosPolicyOverrides withBandwidthPercentageSmb(String bandwidthPercentageSmb) { + this.bandwidthPercentageSmb = bandwidthPercentageSmb; + 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("priorityValue8021Action_Cluster", this.priorityValue8021ActionCluster); + jsonWriter.writeStringField("priorityValue8021Action_SMB", this.priorityValue8021ActionSmb); + jsonWriter.writeStringField("bandwidthPercentage_SMB", this.bandwidthPercentageSmb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QosPolicyOverrides from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QosPolicyOverrides 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 QosPolicyOverrides. + */ + public static QosPolicyOverrides fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QosPolicyOverrides deserializedQosPolicyOverrides = new QosPolicyOverrides(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priorityValue8021Action_Cluster".equals(fieldName)) { + deserializedQosPolicyOverrides.priorityValue8021ActionCluster = reader.getString(); + } else if ("priorityValue8021Action_SMB".equals(fieldName)) { + deserializedQosPolicyOverrides.priorityValue8021ActionSmb = reader.getString(); + } else if ("bandwidthPercentage_SMB".equals(fieldName)) { + deserializedQosPolicyOverrides.bandwidthPercentageSmb = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQosPolicyOverrides; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java new file mode 100644 index 000000000000..ea79acc5d7ce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.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 RawCertificateData model. + */ +@Fluent +public final class RawCertificateData implements JsonSerializable { + /* + * The certificates property. + */ + private List certificates; + + /** + * Creates an instance of RawCertificateData class. + */ + public RawCertificateData() { + } + + /** + * Get the certificates property: The certificates property. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The certificates property. + * + * @param certificates the certificates value to set. + * @return the RawCertificateData object itself. + */ + public RawCertificateData withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("certificates", this.certificates, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RawCertificateData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RawCertificateData 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 RawCertificateData. + */ + public static RawCertificateData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RawCertificateData deserializedRawCertificateData = new RawCertificateData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificates".equals(fieldName)) { + List certificates = reader.readArray(reader1 -> reader1.getString()); + deserializedRawCertificateData.certificates = certificates; + } else { + reader.skipChildren(); + } + } + + return deserializedRawCertificateData; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java new file mode 100644 index 000000000000..b5c480f9751b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.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 values for RebootRequirement. + */ +public final class RebootRequirement extends ExpandableStringEnum { + /** + * Static value Unknown for RebootRequirement. + */ + public static final RebootRequirement UNKNOWN = fromString("Unknown"); + + /** + * Static value True for RebootRequirement. + */ + public static final RebootRequirement TRUE = fromString("True"); + + /** + * Static value False for RebootRequirement. + */ + public static final RebootRequirement FALSE = fromString("False"); + + /** + * Creates a new instance of RebootRequirement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RebootRequirement() { + } + + /** + * Creates or finds a RebootRequirement from its string representation. + * + * @param name a name to look for. + * @return the corresponding RebootRequirement. + */ + public static RebootRequirement fromString(String name) { + return fromString(name, RebootRequirement.class); + } + + /** + * Gets known RebootRequirement values. + * + * @return known RebootRequirement values. + */ + public static Collection values() { + return values(RebootRequirement.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 new file mode 100644 index 000000000000..db3f735fe5b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ReportedProperties.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.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 ReportedProperties implements JsonSerializable { + /* + * validation status of AzureStackHCI Cluster Deployment. + */ + private ValidationStatus validationStatus; + + /* + * Deployment status of AzureStackHCI Cluster Deployment. + */ + private DeploymentStatus deploymentStatus; + + /** + * Creates an instance of ReportedProperties class. + */ + public ReportedProperties() { + } + + /** + * Get the validationStatus property: validation status of AzureStackHCI Cluster Deployment. + * + * @return the validationStatus value. + */ + public ValidationStatus validationStatus() { + return this.validationStatus; + } + + /** + * Get the deploymentStatus property: Deployment status of AzureStackHCI Cluster Deployment. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus 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 ReportedProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportedProperties 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 ReportedProperties. + */ + public static ReportedProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportedProperties deserializedReportedProperties = new ReportedProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validationStatus".equals(fieldName)) { + deserializedReportedProperties.validationStatus = ValidationStatus.fromJson(reader); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedReportedProperties.deploymentStatus = DeploymentStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReportedProperties; + }); + } +} 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 index f8756dc42fa8..5c6eb4509c52 100644 --- 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 @@ -4,15 +4,18 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The identity type. */ +/** + * The identity type. + */ public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ + /** + * Enum value SystemAssigned. + */ SYSTEM_ASSIGNED("SystemAssigned"); - /** The actual serialized value for a ResourceIdentityType instance. */ + /** + * The actual serialized value for a ResourceIdentityType instance. + */ private final String value; ResourceIdentityType(String value) { @@ -21,11 +24,10 @@ public enum ResourceIdentityType { /** * Parses a serialized value to a ResourceIdentityType instance. - * + * * @param value the serialized value to parse. * @return the parsed ResourceIdentityType object, or null if unable to parse. */ - @JsonCreator public static ResourceIdentityType fromString(String value) { if (value == null) { return null; @@ -39,8 +41,9 @@ public static ResourceIdentityType fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@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 index 04f511550b73..2934d761b5b0 100644 --- 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 @@ -5,31 +5,37 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Route - Route resource. */ +/** + * Route - Route resource. + */ @Fluent -public final class Route { +public final class Route implements JsonSerializable { /* * Properties of the route. */ - @JsonProperty(value = "properties") private RoutePropertiesFormat innerProperties; /* * Name - name of the subnet */ - @JsonProperty(value = "name") private String name; - /** Creates an instance of Route class. */ + /** + * Creates an instance of Route class. + */ public Route() { } /** * Get the innerProperties property: Properties of the route. - * + * * @return the innerProperties value. */ private RoutePropertiesFormat innerProperties() { @@ -38,7 +44,7 @@ private RoutePropertiesFormat innerProperties() { /** * Get the name property: Name - name of the subnet. - * + * * @return the name value. */ public String name() { @@ -47,7 +53,7 @@ public String name() { /** * Set the name property: Name - name of the subnet. - * + * * @param name the name value to set. * @return the Route object itself. */ @@ -58,7 +64,7 @@ public Route withName(String name) { /** * Get the addressPrefix property: The destination CIDR to which the route applies. - * + * * @return the addressPrefix value. */ public String addressPrefix() { @@ -67,7 +73,7 @@ public String 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. */ @@ -82,7 +88,7 @@ public Route withAddressPrefix(String addressPrefix) { /** * 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() { @@ -92,7 +98,7 @@ public String 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. */ @@ -106,7 +112,7 @@ public Route withNextHopIpAddress(String nextHopIpAddress) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -114,4 +120,43 @@ public void validate() { 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 index 91caf6ab6f72..6bd3bfc396ac 100644 --- 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 @@ -5,44 +5,48 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Route table resource. */ +/** + * Route table resource. + */ @Fluent -public final class RouteTable { +public final class RouteTable implements JsonSerializable { /* * A unique read-only string that changes whenever the resource is updated. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * Resource name. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Resource type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Properties of the route table. */ - @JsonProperty(value = "properties") private RouteTablePropertiesFormat innerProperties; - /** Creates an instance of RouteTable class. */ + /** + * 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() { @@ -51,7 +55,7 @@ public String etag() { /** * Get the name property: Resource name. - * + * * @return the name value. */ public String name() { @@ -60,7 +64,7 @@ public String name() { /** * Get the type property: Resource type. - * + * * @return the type value. */ public String type() { @@ -69,7 +73,7 @@ public String type() { /** * Get the innerProperties property: Properties of the route table. - * + * * @return the innerProperties value. */ private RouteTablePropertiesFormat innerProperties() { @@ -78,7 +82,7 @@ private RouteTablePropertiesFormat innerProperties() { /** * Get the routes property: Collection of routes contained within a route table. - * + * * @return the routes value. */ public List routes() { @@ -87,7 +91,7 @@ public List 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. */ @@ -101,7 +105,7 @@ public RouteTable withRoutes(List routes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -109,4 +113,46 @@ public void validate() { 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/ScaleUnits.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.java new file mode 100644 index 000000000000..55616d9f4453 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ScaleUnits.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.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; + +/** + * Scale units will contains list of deployment data. + */ +@Fluent +public final class ScaleUnits implements JsonSerializable { + /* + * Deployment Data to deploy AzureStackHCI Cluster. + */ + private DeploymentData deploymentData; + + /** + * Creates an instance of ScaleUnits class. + */ + public ScaleUnits() { + } + + /** + * Get the deploymentData property: Deployment Data to deploy AzureStackHCI Cluster. + * + * @return the deploymentData value. + */ + public DeploymentData deploymentData() { + return this.deploymentData; + } + + /** + * Set the deploymentData property: Deployment Data to deploy AzureStackHCI Cluster. + * + * @param deploymentData the deploymentData value to set. + * @return the ScaleUnits object itself. + */ + public ScaleUnits withDeploymentData(DeploymentData deploymentData) { + this.deploymentData = deploymentData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deploymentData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property deploymentData in model ScaleUnits")); + } else { + deploymentData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScaleUnits.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("deploymentData", this.deploymentData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleUnits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleUnits 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 ScaleUnits. + */ + public static ScaleUnits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleUnits deserializedScaleUnits = new ScaleUnits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentData".equals(fieldName)) { + deserializedScaleUnits.deploymentData = DeploymentData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleUnits; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityComplianceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityComplianceStatus.java new file mode 100644 index 000000000000..19ace3f65e30 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecurityComplianceStatus.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Security compliance properties of the resource. + */ +@Immutable +public final class SecurityComplianceStatus implements JsonSerializable { + /* + * Indicates whether HCI hosts meets secured-core server requirements. + */ + private ComplianceStatus securedCoreCompliance; + + /* + * Indicates whether HCI hosts have enforced consistent Windows Defender Application Control. + */ + private ComplianceStatus wdacCompliance; + + /* + * Indicates whether data at-rest encryption is enabled on Azure Stack HCI clustered volumes. + */ + private ComplianceStatus dataAtRestEncrypted; + + /* + * Indicates whether HCI cluster has data in-transit protection. + */ + private ComplianceStatus dataInTransitProtected; + + /* + * Time in UTC when compliance status was last updated. + */ + private OffsetDateTime lastUpdated; + + /** + * Creates an instance of SecurityComplianceStatus class. + */ + public SecurityComplianceStatus() { + } + + /** + * Get the securedCoreCompliance property: Indicates whether HCI hosts meets secured-core server requirements. + * + * @return the securedCoreCompliance value. + */ + public ComplianceStatus securedCoreCompliance() { + return this.securedCoreCompliance; + } + + /** + * Get the wdacCompliance property: Indicates whether HCI hosts have enforced consistent Windows Defender + * Application Control. + * + * @return the wdacCompliance value. + */ + public ComplianceStatus wdacCompliance() { + return this.wdacCompliance; + } + + /** + * Get the dataAtRestEncrypted property: Indicates whether data at-rest encryption is enabled on Azure Stack HCI + * clustered volumes. + * + * @return the dataAtRestEncrypted value. + */ + public ComplianceStatus dataAtRestEncrypted() { + return this.dataAtRestEncrypted; + } + + /** + * Get the dataInTransitProtected property: Indicates whether HCI cluster has data in-transit protection. + * + * @return the dataInTransitProtected value. + */ + public ComplianceStatus dataInTransitProtected() { + return this.dataInTransitProtected; + } + + /** + * Get the lastUpdated property: Time in UTC when compliance status was last updated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * 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 SecurityComplianceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityComplianceStatus 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 SecurityComplianceStatus. + */ + public static SecurityComplianceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityComplianceStatus deserializedSecurityComplianceStatus = new SecurityComplianceStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securedCoreCompliance".equals(fieldName)) { + deserializedSecurityComplianceStatus.securedCoreCompliance + = ComplianceStatus.fromString(reader.getString()); + } else if ("wdacCompliance".equals(fieldName)) { + deserializedSecurityComplianceStatus.wdacCompliance + = ComplianceStatus.fromString(reader.getString()); + } else if ("dataAtRestEncrypted".equals(fieldName)) { + deserializedSecurityComplianceStatus.dataAtRestEncrypted + = ComplianceStatus.fromString(reader.getString()); + } else if ("dataInTransitProtected".equals(fieldName)) { + deserializedSecurityComplianceStatus.dataInTransitProtected + = ComplianceStatus.fromString(reader.getString()); + } else if ("lastUpdated".equals(fieldName)) { + deserializedSecurityComplianceStatus.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityComplianceStatus; + }); + } +} 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 new file mode 100644 index 000000000000..87dcdc2d96cd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySetting.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.SecuritySettingInner; + +/** + * An immutable client-side representation of SecuritySetting. + */ +public interface SecuritySetting { + /** + * 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 securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @return the securedCoreComplianceAssignment value. + */ + ComplianceAssignmentType securedCoreComplianceAssignment(); + + /** + * Gets the securityComplianceStatus property: Security Compliance Status. + * + * @return the securityComplianceStatus value. + */ + SecurityComplianceStatus securityComplianceStatus(); + + /** + * Gets the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * 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.SecuritySettingInner object. + * + * @return the inner object. + */ + SecuritySettingInner innerModel(); + + /** + * The entirety of the SecuritySetting definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecuritySetting definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecuritySetting definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecuritySetting definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the SecuritySetting 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.WithSecuredCoreComplianceAssignment, DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecuritySetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecuritySetting create(Context context); + } + + /** + * The stage of the SecuritySetting definition allowing to specify securedCoreComplianceAssignment. + */ + interface WithSecuredCoreComplianceAssignment { + /** + * Specifies the securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @param securedCoreComplianceAssignment Secured Core Compliance Assignment. + * @return the next definition stage. + */ + WithCreate withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment); + } + + /** + * The stage of the SecuritySetting definition allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The status of the last operation.. + * + * @param provisioningState The status of the last operation. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + } + + /** + * Begins update for the SecuritySetting resource. + * + * @return the stage of resource update. + */ + SecuritySetting.Update update(); + + /** + * The template for SecuritySetting update. + */ + interface Update extends UpdateStages.WithSecuredCoreComplianceAssignment, UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecuritySetting apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecuritySetting apply(Context context); + } + + /** + * The SecuritySetting update stages. + */ + interface UpdateStages { + /** + * The stage of the SecuritySetting update allowing to specify securedCoreComplianceAssignment. + */ + interface WithSecuredCoreComplianceAssignment { + /** + * Specifies the securedCoreComplianceAssignment property: Secured Core Compliance Assignment. + * + * @param securedCoreComplianceAssignment Secured Core Compliance Assignment. + * @return the next definition stage. + */ + Update withSecuredCoreComplianceAssignment(ComplianceAssignmentType securedCoreComplianceAssignment); + } + + /** + * The stage of the SecuritySetting update allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The status of the last operation.. + * + * @param provisioningState The status of the last operation. + * @return the next definition stage. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecuritySetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecuritySetting refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettingListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettingListResult.java new file mode 100644 index 000000000000..fecf39e27e63 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettingListResult.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.SecuritySettingInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SecuritySetting list operation. + */ +@Fluent +public final class SecuritySettingListResult implements JsonSerializable { + /* + * The SecuritySetting items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SecuritySettingListResult class. + */ + public SecuritySettingListResult() { + } + + /** + * Get the value property: The SecuritySetting items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SecuritySetting items on this page. + * + * @param value the value value to set. + * @return the SecuritySettingListResult object itself. + */ + public SecuritySettingListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SecuritySettingListResult object itself. + */ + public SecuritySettingListResult 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) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model SecuritySettingListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecuritySettingListResult.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 SecuritySettingListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecuritySettingListResult 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 SecuritySettingListResult. + */ + public static SecuritySettingListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecuritySettingListResult deserializedSecuritySettingListResult = new SecuritySettingListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecuritySettingInner.fromJson(reader1)); + deserializedSecuritySettingListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecuritySettingListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecuritySettingListResult; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettings.java new file mode 100644 index 000000000000..ec1c1e6b2359 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SecuritySettings.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SecuritySettings. + */ +public interface SecuritySettings { + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusters(String resourceGroupName, String clusterName); + + /** + * List SecuritySetting resources by Clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecuritySetting list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SecuritySetting along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String securitySettingsName, + Context context); + + /** + * Get a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SecuritySetting. + */ + SecuritySetting get(String resourceGroupName, String clusterName, String securitySettingsName); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String securitySettingsName); + + /** + * Delete a SecuritySetting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param securitySettingsName Name of security setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String securitySettingsName, Context context); + + /** + * Get a SecuritySetting. + * + * @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 SecuritySetting along with {@link Response}. + */ + SecuritySetting getById(String id); + + /** + * Get a SecuritySetting. + * + * @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 SecuritySetting along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SecuritySetting. + * + * @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 SecuritySetting. + * + * @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 SecuritySetting resource. + * + * @param name resource name. + * @return the first stage of the new SecuritySetting definition. + */ + SecuritySetting.DefinitionStages.Blank define(String name); +} 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 index 5d8926382c65..08620dc47924 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * SecurityType to function. */ public final class SecurityTypes extends ExpandableStringEnum { - /** Static value TrustedLaunch for SecurityTypes. */ + /** + * Static value TrustedLaunch for SecurityTypes. + */ public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); - /** Static value ConfidentialVM for SecurityTypes. */ + /** + * 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 @@ -30,18 +33,17 @@ public SecurityTypes() { /** * Creates or finds a SecurityTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding SecurityTypes. */ - @JsonCreator public static SecurityTypes fromString(String name) { return fromString(name, SecurityTypes.class); } /** * Gets known SecurityTypes values. - * + * * @return known SecurityTypes values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java new file mode 100644 index 000000000000..64f07a90f804 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. Critical + * is the only update-blocking severity. + */ +public final class Severity extends ExpandableStringEnum { + /** + * Static value Critical for Severity. + */ + public static final Severity CRITICAL = fromString("Critical"); + + /** + * Static value Warning for Severity. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Static value Informational for Severity. + */ + public static final Severity INFORMATIONAL = fromString("Informational"); + + /** + * Static value Hidden for Severity. + */ + public static final Severity HIDDEN = fromString("Hidden"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java new file mode 100644 index 000000000000..0afd618342ca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights 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.SkuInner; +import java.util.List; + +/** + * An immutable client-side representation of Sku. + */ +public interface Sku { + /** + * 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 provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + String publisherId(); + + /** + * Gets the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + String offerId(); + + /** + * Gets the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + String content(); + + /** + * Gets the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + List skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner object. + * + * @return the inner object. + */ + SkuInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java new file mode 100644 index 000000000000..12783f9b69b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.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.Immutable; +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.SkuInner; +import java.io.IOException; +import java.util.List; + +/** + * List of SKU proxy resources for the HCI cluster. + */ +@Immutable +public final class SkuList implements JsonSerializable { + /* + * List of SKU proxy resources. + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SkuList class. + */ + public SkuList() { + } + + /** + * Get the value property: List of SKU proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuList 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 SkuList. + */ + public static SkuList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuList deserializedSkuList = new SkuList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SkuInner.fromJson(reader1)); + deserializedSkuList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSkuList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java new file mode 100644 index 000000000000..ecbd79dfe8b5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * SKU Mapping details. + */ +@Fluent +public final class SkuMappings implements JsonSerializable { + /* + * Identifier of the CatalogPlan for the sku + */ + private String catalogPlanId; + + /* + * Identifier for the sku + */ + private String marketplaceSkuId; + + /* + * Array of SKU versions available + */ + private List marketplaceSkuVersions; + + /** + * Creates an instance of SkuMappings class. + */ + public SkuMappings() { + } + + /** + * Get the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @return the catalogPlanId value. + */ + public String catalogPlanId() { + return this.catalogPlanId; + } + + /** + * Set the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @param catalogPlanId the catalogPlanId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withCatalogPlanId(String catalogPlanId) { + this.catalogPlanId = catalogPlanId; + return this; + } + + /** + * Get the marketplaceSkuId property: Identifier for the sku. + * + * @return the marketplaceSkuId value. + */ + public String marketplaceSkuId() { + return this.marketplaceSkuId; + } + + /** + * Set the marketplaceSkuId property: Identifier for the sku. + * + * @param marketplaceSkuId the marketplaceSkuId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuId(String marketplaceSkuId) { + this.marketplaceSkuId = marketplaceSkuId; + return this; + } + + /** + * Get the marketplaceSkuVersions property: Array of SKU versions available. + * + * @return the marketplaceSkuVersions value. + */ + public List marketplaceSkuVersions() { + return this.marketplaceSkuVersions; + } + + /** + * Set the marketplaceSkuVersions property: Array of SKU versions available. + * + * @param marketplaceSkuVersions the marketplaceSkuVersions value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuVersions(List marketplaceSkuVersions) { + this.marketplaceSkuVersions = marketplaceSkuVersions; + 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("catalogPlanId", this.catalogPlanId); + jsonWriter.writeStringField("marketplaceSkuId", this.marketplaceSkuId); + jsonWriter.writeArrayField("marketplaceSkuVersions", this.marketplaceSkuVersions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuMappings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuMappings 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 SkuMappings. + */ + public static SkuMappings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuMappings deserializedSkuMappings = new SkuMappings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("catalogPlanId".equals(fieldName)) { + deserializedSkuMappings.catalogPlanId = reader.getString(); + } else if ("marketplaceSkuId".equals(fieldName)) { + deserializedSkuMappings.marketplaceSkuId = reader.getString(); + } else if ("marketplaceSkuVersions".equals(fieldName)) { + List marketplaceSkuVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedSkuMappings.marketplaceSkuVersions = marketplaceSkuVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuMappings; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java new file mode 100644 index 000000000000..8bbe0d59885a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Skus. + */ +public interface Skus { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, + String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer(String resourceGroupName, String clusterName, String publisherName, String offerName, + String expand, Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String publisherName, String offerName, + String skuName, String expand, Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + Sku get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java new file mode 100644 index 000000000000..5f1f37da29fc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.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 SoftwareAssuranceChangeRequest model. + */ +@Fluent +public final class SoftwareAssuranceChangeRequest implements JsonSerializable { + /* + * The properties property. + */ + private SoftwareAssuranceChangeRequestProperties properties; + + /** + * Creates an instance of SoftwareAssuranceChangeRequest class. + */ + public SoftwareAssuranceChangeRequest() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public SoftwareAssuranceChangeRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the SoftwareAssuranceChangeRequest object itself. + */ + public SoftwareAssuranceChangeRequest withProperties(SoftwareAssuranceChangeRequestProperties 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 SoftwareAssuranceChangeRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftwareAssuranceChangeRequest 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 SoftwareAssuranceChangeRequest. + */ + public static SoftwareAssuranceChangeRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftwareAssuranceChangeRequest deserializedSoftwareAssuranceChangeRequest + = new SoftwareAssuranceChangeRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSoftwareAssuranceChangeRequest.properties + = SoftwareAssuranceChangeRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftwareAssuranceChangeRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java new file mode 100644 index 000000000000..b5a135f31499 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.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 SoftwareAssuranceChangeRequestProperties model. + */ +@Fluent +public final class SoftwareAssuranceChangeRequestProperties + implements JsonSerializable { + /* + * Customer Intent for Software Assurance Benefit. + */ + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /** + * Creates an instance of SoftwareAssuranceChangeRequestProperties class. + */ + public SoftwareAssuranceChangeRequestProperties() { + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceChangeRequestProperties object itself. + */ + public SoftwareAssuranceChangeRequestProperties + withSoftwareAssuranceIntent(SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + 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("softwareAssuranceIntent", + this.softwareAssuranceIntent == null ? null : this.softwareAssuranceIntent.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftwareAssuranceChangeRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftwareAssuranceChangeRequestProperties 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 SoftwareAssuranceChangeRequestProperties. + */ + public static SoftwareAssuranceChangeRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftwareAssuranceChangeRequestProperties deserializedSoftwareAssuranceChangeRequestProperties + = new SoftwareAssuranceChangeRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softwareAssuranceIntent".equals(fieldName)) { + deserializedSoftwareAssuranceChangeRequestProperties.softwareAssuranceIntent + = SoftwareAssuranceIntent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftwareAssuranceChangeRequestProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java new file mode 100644 index 000000000000..790a4da3e90f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.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; + +/** + * Customer Intent for Software Assurance Benefit. + */ +public final class SoftwareAssuranceIntent extends ExpandableStringEnum { + /** + * Static value Enable for SoftwareAssuranceIntent. + */ + public static final SoftwareAssuranceIntent ENABLE = fromString("Enable"); + + /** + * Static value Disable for SoftwareAssuranceIntent. + */ + public static final SoftwareAssuranceIntent DISABLE = fromString("Disable"); + + /** + * Creates a new instance of SoftwareAssuranceIntent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SoftwareAssuranceIntent() { + } + + /** + * Creates or finds a SoftwareAssuranceIntent from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceIntent. + */ + public static SoftwareAssuranceIntent fromString(String name) { + return fromString(name, SoftwareAssuranceIntent.class); + } + + /** + * Gets known SoftwareAssuranceIntent values. + * + * @return known SoftwareAssuranceIntent values. + */ + public static Collection values() { + return values(SoftwareAssuranceIntent.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java new file mode 100644 index 000000000000..baa9e71d5ca7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.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; + +/** + * Software Assurance properties of the cluster. + */ +@Fluent +public final class SoftwareAssuranceProperties implements JsonSerializable { + /* + * Status of the Software Assurance for the cluster. + */ + private SoftwareAssuranceStatus softwareAssuranceStatus; + + /* + * Customer Intent for Software Assurance Benefit. + */ + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /* + * TimeStamp denoting the latest SA benefit applicability is validated. + */ + private OffsetDateTime lastUpdated; + + /** + * Creates an instance of SoftwareAssuranceProperties class. + */ + public SoftwareAssuranceProperties() { + } + + /** + * Get the softwareAssuranceStatus property: Status of the Software Assurance for the cluster. + * + * @return the softwareAssuranceStatus value. + */ + public SoftwareAssuranceStatus softwareAssuranceStatus() { + return this.softwareAssuranceStatus; + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceProperties object itself. + */ + public SoftwareAssuranceProperties withSoftwareAssuranceIntent(SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + return this; + } + + /** + * Get the lastUpdated property: TimeStamp denoting the latest SA benefit applicability is validated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * 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("softwareAssuranceIntent", + this.softwareAssuranceIntent == null ? null : this.softwareAssuranceIntent.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftwareAssuranceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftwareAssuranceProperties 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 SoftwareAssuranceProperties. + */ + public static SoftwareAssuranceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftwareAssuranceProperties deserializedSoftwareAssuranceProperties = new SoftwareAssuranceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softwareAssuranceStatus".equals(fieldName)) { + deserializedSoftwareAssuranceProperties.softwareAssuranceStatus + = SoftwareAssuranceStatus.fromString(reader.getString()); + } else if ("softwareAssuranceIntent".equals(fieldName)) { + deserializedSoftwareAssuranceProperties.softwareAssuranceIntent + = SoftwareAssuranceIntent.fromString(reader.getString()); + } else if ("lastUpdated".equals(fieldName)) { + deserializedSoftwareAssuranceProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftwareAssuranceProperties; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java new file mode 100644 index 000000000000..a8ec2c9653bb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.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; + +/** + * Status of the Software Assurance for the cluster. + */ +public final class SoftwareAssuranceStatus extends ExpandableStringEnum { + /** + * Static value Enabled for SoftwareAssuranceStatus. + */ + public static final SoftwareAssuranceStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for SoftwareAssuranceStatus. + */ + public static final SoftwareAssuranceStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of SoftwareAssuranceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SoftwareAssuranceStatus() { + } + + /** + * Creates or finds a SoftwareAssuranceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceStatus. + */ + public static SoftwareAssuranceStatus fromString(String name) { + return fromString(name, SoftwareAssuranceStatus.class); + } + + /** + * Gets known SoftwareAssuranceStatus values. + * + * @return known SoftwareAssuranceStatus values. + */ + public static Collection values() { + return values(SoftwareAssuranceStatus.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 index 7bbc1dbc3055..c45b95b397d8 100644 --- 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 @@ -5,25 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * SSH configuration for Linux based VMs running on Azure. + */ @Fluent -public final class SshConfiguration { +public final class SshConfiguration implements JsonSerializable { /* * The list of SSH public keys used to authenticate with linux based VMs. */ - @JsonProperty(value = "publicKeys") private List publicKeys; - /** Creates an instance of SshConfiguration class. */ + /** + * 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() { @@ -32,7 +39,7 @@ public List 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. */ @@ -43,7 +50,7 @@ public SshConfiguration withPublicKeys(List publicKeys) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,41 @@ public void validate() { 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 index 9f5d9a30483b..88981782b2c7 100644 --- 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 @@ -5,18 +5,21 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 { +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 */ - @JsonProperty(value = "path") private String path; /* @@ -24,17 +27,18 @@ public final class SshPublicKey { * and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). */ - @JsonProperty(value = "keyData") private String keyData; - /** Creates an instance of SshPublicKey class. */ + /** + * 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() { @@ -44,7 +48,7 @@ public String 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. */ @@ -58,7 +62,7 @@ public SshPublicKey withPath(String path) { * 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() { @@ -70,7 +74,7 @@ public String keyData() { * 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. */ @@ -81,9 +85,48 @@ public SshPublicKey withKeyData(String keyData) { /** * 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/State.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java new file mode 100644 index 000000000000..20a497083023 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of the update as it relates to this stamp. + */ +public final class State extends ExpandableStringEnum { + /** + * Static value HasPrerequisite for State. + */ + public static final State HAS_PREREQUISITE = fromString("HasPrerequisite"); + + /** + * Static value Obsolete for State. + */ + public static final State OBSOLETE = fromString("Obsolete"); + + /** + * Static value Ready for State. + */ + public static final State READY = fromString("Ready"); + + /** + * Static value NotApplicableBecauseAnotherUpdateIsInProgress for State. + */ + public static final State NOT_APPLICABLE_BECAUSE_ANOTHER_UPDATE_IS_IN_PROGRESS + = fromString("NotApplicableBecauseAnotherUpdateIsInProgress"); + + /** + * Static value Preparing for State. + */ + public static final State PREPARING = fromString("Preparing"); + + /** + * Static value Installing for State. + */ + public static final State INSTALLING = fromString("Installing"); + + /** + * Static value Installed for State. + */ + public static final State INSTALLED = fromString("Installed"); + + /** + * Static value PreparationFailed for State. + */ + public static final State PREPARATION_FAILED = fromString("PreparationFailed"); + + /** + * Static value InstallationFailed for State. + */ + public static final State INSTALLATION_FAILED = fromString("InstallationFailed"); + + /** + * Static value Invalid for State. + */ + public static final State INVALID = fromString("Invalid"); + + /** + * Static value Recalled for State. + */ + public static final State RECALLED = fromString("Recalled"); + + /** + * Static value Downloading for State. + */ + public static final State DOWNLOADING = fromString("Downloading"); + + /** + * Static value DownloadFailed for State. + */ + public static final State DOWNLOAD_FAILED = fromString("DownloadFailed"); + + /** + * Static value HealthChecking for State. + */ + public static final State HEALTH_CHECKING = fromString("HealthChecking"); + + /** + * Static value HealthCheckFailed for State. + */ + public static final State HEALTH_CHECK_FAILED = fromString("HealthCheckFailed"); + + /** + * Static value ReadyToInstall for State. + */ + public static final State READY_TO_INSTALL = fromString("ReadyToInstall"); + + /** + * Static value ScanInProgress for State. + */ + public static final State SCAN_IN_PROGRESS = fromString("ScanInProgress"); + + /** + * Static value ScanFailed for State. + */ + public static final State SCAN_FAILED = fromString("ScanFailed"); + + /** + * Static value AdditionalContentRequired for State. + */ + public static final State ADDITIONAL_CONTENT_REQUIRED = fromString("AdditionalContentRequired"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java index 28bf6efd61df..40abf5309c8d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -5,23 +5,90 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The status of the operation performed on the gallery image [Succeeded, Failed, InProgress]. */ +/** + * Status of the cluster agent. + */ public final class Status extends ExpandableStringEnum { - /** Static value Succeeded for Status. */ + /** + * Static value NotYetRegistered for Status. + */ + public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); + + /** + * Static value ConnectedRecently for Status. + */ + public static final Status CONNECTED_RECENTLY = fromString("ConnectedRecently"); + + /** + * Static value NotConnectedRecently for Status. + */ + public static final Status NOT_CONNECTED_RECENTLY = fromString("NotConnectedRecently"); + + /** + * Static value Disconnected for Status. + */ + public static final Status DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Error for Status. + */ + public static final Status ERROR = fromString("Error"); + + /** + * Static value NotSpecified for Status. + */ + public static final Status NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value ValidationInProgress for Status. + */ + public static final Status VALIDATION_IN_PROGRESS = fromString("ValidationInProgress"); + + /** + * Static value ValidationSuccess for Status. + */ + public static final Status VALIDATION_SUCCESS = fromString("ValidationSuccess"); + + /** + * Static value ValidationFailed for Status. + */ + public static final Status VALIDATION_FAILED = fromString("ValidationFailed"); + + /** + * Static value DeploymentInProgress for Status. + */ + public static final Status DEPLOYMENT_IN_PROGRESS = fromString("DeploymentInProgress"); + + /** + * Static value DeploymentFailed for Status. + */ + public static final Status DEPLOYMENT_FAILED = fromString("DeploymentFailed"); + + /** + * Static value DeploymentSuccess for Status. + */ + public static final Status DEPLOYMENT_SUCCESS = fromString("DeploymentSuccess"); + + /** + * Static value Succeeded for Status. + */ public static final Status SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for Status. */ + /** + * Static value Failed for Status. + */ public static final Status FAILED = fromString("Failed"); - /** Static value InProgress for Status. */ + /** + * Static value InProgress for Status. + */ public static final Status IN_PROGRESS = fromString("InProgress"); /** * Creates a new instance of Status value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +97,17 @@ public Status() { /** * Creates or finds a Status from its string representation. - * + * * @param name a name to look for. * @return the corresponding Status. */ - @JsonCreator public static Status fromString(String name) { return fromString(name, Status.class); } /** * Gets known Status values. - * + * * @return known Status values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java index 961c0cb87ee5..f69157a93669 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The level code. */ +/** + * The level code. + */ public final class StatusLevelTypes extends ExpandableStringEnum { - /** Static value Info for StatusLevelTypes. */ + /** + * Static value Info for StatusLevelTypes. + */ public static final StatusLevelTypes INFO = fromString("Info"); - /** Static value Warning for StatusLevelTypes. */ + /** + * Static value Warning for StatusLevelTypes. + */ public static final StatusLevelTypes WARNING = fromString("Warning"); - /** Static value Error for StatusLevelTypes. */ + /** + * Static value Error for StatusLevelTypes. + */ public static final StatusLevelTypes ERROR = fromString("Error"); /** * Creates a new instance of StatusLevelTypes value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public StatusLevelTypes() { /** * Creates or finds a StatusLevelTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding StatusLevelTypes. */ - @JsonCreator public static StatusLevelTypes fromString(String name) { return fromString(name, StatusLevelTypes.class); } /** * Gets known StatusLevelTypes values. - * + * * @return known StatusLevelTypes values. */ public static Collection values() { 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 index af8474403d21..bd306c57fa3d 100644 --- 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 @@ -5,23 +5,30 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The installation status of the hybrid machine agent installation. */ +/** + * The installation status of the hybrid machine agent installation. + */ public final class StatusTypes extends ExpandableStringEnum { - /** Static value Succeeded for StatusTypes. */ + /** + * Static value Succeeded for StatusTypes. + */ public static final StatusTypes SUCCEEDED = fromString("Succeeded"); - /** Static value InProgress for StatusTypes. */ + /** + * Static value InProgress for StatusTypes. + */ public static final StatusTypes IN_PROGRESS = fromString("InProgress"); - /** Static value Failed for StatusTypes. */ + /** + * 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 @@ -30,18 +37,17 @@ public StatusTypes() { /** * Creates or finds a StatusTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding StatusTypes. */ - @JsonCreator public static StatusTypes fromString(String name) { return fromString(name, StatusTypes.class); } /** * Gets known StatusTypes values. - * + * * @return known StatusTypes values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storage.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storage.java new file mode 100644 index 000000000000..1c2a28e0e6b2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storage.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 Storage config of AzureStackHCI Cluster. + */ +@Fluent +public final class Storage implements JsonSerializable { + /* + * By default, this mode is set to Express and your storage is configured as per best practices based on the number + * of nodes in the cluster. Allowed values are 'Express','InfraOnly', 'KeepStorage' + */ + private String configurationMode; + + /** + * Creates an instance of Storage class. + */ + public Storage() { + } + + /** + * Get the configurationMode property: By default, this mode is set to Express and your storage is configured as per + * best practices based on the number of nodes in the cluster. Allowed values are 'Express','InfraOnly', + * 'KeepStorage'. + * + * @return the configurationMode value. + */ + public String configurationMode() { + return this.configurationMode; + } + + /** + * Set the configurationMode property: By default, this mode is set to Express and your storage is configured as per + * best practices based on the number of nodes in the cluster. Allowed values are 'Express','InfraOnly', + * 'KeepStorage'. + * + * @param configurationMode the configurationMode value to set. + * @return the Storage object itself. + */ + public Storage withConfigurationMode(String configurationMode) { + this.configurationMode = configurationMode; + 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("configurationMode", this.configurationMode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Storage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Storage 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 Storage. + */ + public static Storage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Storage deserializedStorage = new Storage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationMode".equals(fieldName)) { + deserializedStorage.configurationMode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorage; + }); + } +} 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 index a8603a5725f3..e05a8195dedb 100644 --- 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 @@ -5,48 +5,51 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The observed state of storage containers. */ +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 { +public final class StorageContainerStatus implements JsonSerializable { /* * StorageContainer provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * Amount of space available on the disk in MB */ - @JsonProperty(value = "availableSizeMB") private Long availableSizeMB; /* * Total size of the disk in MB */ - @JsonProperty(value = "containerSizeMB") private Long containerSizeMB; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private StorageContainerStatusProvisioningStatus provisioningStatus; - /** Creates an instance of StorageContainerStatus class. */ + /** + * Creates an instance of StorageContainerStatus class. + */ public StorageContainerStatus() { } /** * Get the errorCode property: StorageContainer provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -55,7 +58,7 @@ public String errorCode() { /** * Set the errorCode property: StorageContainer provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the StorageContainerStatus object itself. */ @@ -66,7 +69,7 @@ public StorageContainerStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -75,7 +78,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the StorageContainerStatus object itself. */ @@ -86,7 +89,7 @@ public StorageContainerStatus withErrorMessage(String errorMessage) { /** * Get the availableSizeMB property: Amount of space available on the disk in MB. - * + * * @return the availableSizeMB value. */ public Long availableSizeMB() { @@ -95,7 +98,7 @@ public Long 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. */ @@ -106,7 +109,7 @@ public StorageContainerStatus withAvailableSizeMB(Long availableSizeMB) { /** * Get the containerSizeMB property: Total size of the disk in MB. - * + * * @return the containerSizeMB value. */ public Long containerSizeMB() { @@ -115,7 +118,7 @@ public Long containerSizeMB() { /** * Set the containerSizeMB property: Total size of the disk in MB. - * + * * @param containerSizeMB the containerSizeMB value to set. * @return the StorageContainerStatus object itself. */ @@ -126,7 +129,7 @@ public StorageContainerStatus withContainerSizeMB(Long containerSizeMB) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public StorageContainerStatusProvisioningStatus provisioningStatus() { @@ -135,7 +138,7 @@ public StorageContainerStatusProvisioningStatus provisioningStatus() { /** * Set the provisioningStatus property: The provisioningStatus property. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the StorageContainerStatus object itself. */ @@ -146,7 +149,7 @@ public StorageContainerStatus withProvisioningStatus(StorageContainerStatusProvi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -154,4 +157,53 @@ public void validate() { 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 index 895cf66c5d7e..c0937558fc4c 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The StorageContainerStatusProvisioningStatus model. + */ @Fluent -public final class StorageContainerStatusProvisioningStatus { +public final class StorageContainerStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the storage container */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the storage container [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of StorageContainerStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public StorageContainerStatusProvisioningStatus withOperationId(String operation /** * Get the status property: The status of the operation performed on the storage container [Succeeded, Failed, * InProgress]. - * + * * @return the status value. */ public Status status() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,49 @@ public StorageContainerStatusProvisioningStatus withStatus(Status status) { /** * 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 index 52560f11a342..5c703074eb36 100644 --- 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 @@ -10,125 +10,132 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner; import java.util.Map; -/** An immutable client-side representation of StorageContainers. */ +/** + * 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 entirety of the StorageContainers definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The StorageContainers definition stages. */ + /** + * The StorageContainers definition stages. + */ interface DefinitionStages { - /** The first stage of the StorageContainers definition. */ + /** + * The first stage of the StorageContainers definition. + */ interface Blank extends WithLocation { } - /** The stage of the StorageContainers definition allowing to specify location. */ + /** + * 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. */ @@ -136,18 +143,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -162,47 +171,53 @@ 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -212,36 +227,42 @@ interface WithPath { /** * Begins update for the StorageContainers resource. - * + * * @return the stage of resource update. */ StorageContainers.Update update(); - /** The template for StorageContainers 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. */ + /** + * The StorageContainers update stages. + */ interface UpdateStages { - /** The stage of the StorageContainers update allowing to specify tags. */ + /** + * 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. */ @@ -251,14 +272,14 @@ interface WithTags { /** * 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. */ 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 index 48abe2a4e5c6..7d47cc6618e4 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The StorageContainersListResult model. */ +/** + * The StorageContainersListResult model. + */ @Fluent -public final class StorageContainersListResult { +public final class StorageContainersListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of StorageContainersListResult class. */ + /** + * Creates an instance of StorageContainersListResult class. + */ public StorageContainersListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the StorageContainersListResult object itself. */ @@ -50,7 +56,7 @@ public StorageContainersListResult withValue(List value) /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The nextLink property. - * + * * @param nextLink the nextLink value to set. * @return the StorageContainersListResult object itself. */ @@ -70,7 +76,7 @@ public StorageContainersListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { 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 index ae754fde86a5..81970d075ceb 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of StorageContainersOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface StorageContainersOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new StorageContainers resource. - * + * * @param name resource name. * @return the first stage of the new StorageContainers definition. */ 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 index 90a85e3dce0c..ffec46cc43be 100644 --- 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 @@ -5,27 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The storage container resource patch definition. + */ @Fluent -public final class StorageContainersUpdateRequest { +public final class StorageContainersUpdateRequest implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of StorageContainersUpdateRequest class. */ + /** + * Creates an instance of StorageContainersUpdateRequest class. + */ public StorageContainersUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the StorageContainersUpdateRequest object itself. */ @@ -45,9 +50,47 @@ public StorageContainersUpdateRequest withTags(Map tags) { /** * 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/StorageNetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageNetworks.java new file mode 100644 index 000000000000..16a9f8c45392 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageNetworks.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights 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 StorageNetworks of a cluster. + */ +@Fluent +public final class StorageNetworks 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 vlanId; + + /** + * Creates an instance of StorageNetworks class. + */ + public StorageNetworks() { + } + + /** + * Get the name property: Name of the storage network. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the storage network. + * + * @param name the name value to set. + * @return the StorageNetworks object itself. + */ + public StorageNetworks withName(String name) { + this.name = name; + return this; + } + + /** + * Get the networkAdapterName property: Name of the storage network adapter. + * + * @return the networkAdapterName value. + */ + public String networkAdapterName() { + return this.networkAdapterName; + } + + /** + * Set the networkAdapterName property: Name of the storage network adapter. + * + * @param networkAdapterName the networkAdapterName value to set. + * @return the StorageNetworks object itself. + */ + public StorageNetworks withNetworkAdapterName(String networkAdapterName) { + this.networkAdapterName = networkAdapterName; + return this; + } + + /** + * Get the vlanId 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 vlanId value. + */ + public String vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: ID specified for the VLAN storage network. This setting is applied to the network + * interfaces that route the storage and VM migration traffic. + * + * @param vlanId the vlanId value to set. + * @return the StorageNetworks object itself. + */ + public StorageNetworks withVlanId(String vlanId) { + this.vlanId = vlanId; + 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("name", this.name); + jsonWriter.writeStringField("networkAdapterName", this.networkAdapterName); + jsonWriter.writeStringField("vlanId", this.vlanId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageNetworks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 StorageNetworks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageNetworks deserializedStorageNetworks = new StorageNetworks(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStorageNetworks.name = reader.getString(); + } else if ("networkAdapterName".equals(fieldName)) { + deserializedStorageNetworks.networkAdapterName = reader.getString(); + } else if ("vlanId".equals(fieldName)) { + deserializedStorageNetworks.vlanId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + 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 index 16dbf2a6ecac..f0576951028e 100644 --- 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 @@ -5,25 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The StorageProfileUpdate model. + */ @Fluent -public final class StorageProfileUpdate { +public final class StorageProfileUpdate implements JsonSerializable { /* * adds data disks to the virtual machine instance for the update call */ - @JsonProperty(value = "dataDisks") private List dataDisks; - /** Creates an instance of StorageProfileUpdate class. */ + /** + * 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() { @@ -32,7 +39,7 @@ public List 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. */ @@ -43,7 +50,7 @@ public StorageProfileUpdate withDataDisks(List 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 index 19972d824357..75215a263a47 100644 --- 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 @@ -5,24 +5,31 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The StorageProfileUpdateDataDisksItem model. + */ @Fluent -public final class StorageProfileUpdateDataDisksItem { +public final class StorageProfileUpdateDataDisksItem implements JsonSerializable { /* * The id property. */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of StorageProfileUpdateDataDisksItem class. */ + /** + * Creates an instance of StorageProfileUpdateDataDisksItem class. + */ public StorageProfileUpdateDataDisksItem() { } /** * Get the id property: The id property. - * + * * @return the id value. */ public String id() { @@ -31,7 +38,7 @@ public String id() { /** * Set the id property: The id property. - * + * * @param id the id value to set. * @return the StorageProfileUpdateDataDisksItem object itself. */ @@ -42,9 +49,46 @@ public StorageProfileUpdateDataDisksItem withId(String id) { /** * 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 index ae4654e4efa9..3aa8750d4a73 100644 --- 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 @@ -5,33 +5,39 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The Subnet model. */ +/** + * The Subnet model. + */ @Fluent -public final class Subnet { +public final class Subnet implements JsonSerializable { /* * Properties of the subnet. */ - @JsonProperty(value = "properties") 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. */ - @JsonProperty(value = "name") private String name; - /** Creates an instance of Subnet class. */ + /** + * Creates an instance of Subnet class. + */ public Subnet() { } /** * Get the innerProperties property: Properties of the subnet. - * + * * @return the innerProperties value. */ private SubnetPropertiesFormat innerProperties() { @@ -41,7 +47,7 @@ private SubnetPropertiesFormat 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() { @@ -51,7 +57,7 @@ public String 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. */ @@ -62,7 +68,7 @@ public Subnet withName(String name) { /** * Get the addressPrefix property: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. - * + * * @return the addressPrefix value. */ public String addressPrefix() { @@ -71,7 +77,7 @@ public String 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. */ @@ -85,7 +91,7 @@ public Subnet withAddressPrefix(String addressPrefix) { /** * Get the addressPrefixes property: List of address prefixes for the subnet. - * + * * @return the addressPrefixes value. */ public List addressPrefixes() { @@ -94,7 +100,7 @@ public List addressPrefixes() { /** * Set the addressPrefixes property: List of address prefixes for the subnet. - * + * * @param addressPrefixes the addressPrefixes value to set. * @return the Subnet object itself. */ @@ -109,7 +115,7 @@ public Subnet withAddressPrefixes(List addressPrefixes) { /** * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values * include: 'Static', 'Dynamic'. - * + * * @return the ipAllocationMethod value. */ public IpAllocationMethodEnum ipAllocationMethod() { @@ -119,7 +125,7 @@ public IpAllocationMethodEnum 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. */ @@ -133,7 +139,7 @@ public Subnet withIpAllocationMethod(IpAllocationMethodEnum ipAllocationMethod) /** * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. - * + * * @return the ipConfigurationReferences value. */ public List ipConfigurationReferences() { @@ -142,7 +148,7 @@ public List ipConfiguration /** * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. - * + * * @param ipConfigurationReferences the ipConfigurationReferences value to set. * @return the Subnet object itself. */ @@ -157,7 +163,7 @@ public Subnet withIpConfigurationReferences( /** * Get the routeTable property: Route table resource. - * + * * @return the routeTable value. */ public RouteTable routeTable() { @@ -166,7 +172,7 @@ public RouteTable routeTable() { /** * Set the routeTable property: Route table resource. - * + * * @param routeTable the routeTable value to set. * @return the Subnet object itself. */ @@ -180,7 +186,7 @@ public Subnet withRouteTable(RouteTable routeTable) { /** * Get the ipPools property: network associated pool of IP Addresses. - * + * * @return the ipPools value. */ public List ipPools() { @@ -189,7 +195,7 @@ public List ipPools() { /** * Set the ipPools property: network associated pool of IP Addresses. - * + * * @param ipPools the ipPools value to set. * @return the Subnet object itself. */ @@ -203,7 +209,7 @@ public Subnet withIpPools(List ipPools) { /** * Get the vlan property: Vlan to use for the subnet. - * + * * @return the vlan value. */ public Integer vlan() { @@ -212,7 +218,7 @@ public Integer vlan() { /** * Set the vlan property: Vlan to use for the subnet. - * + * * @param vlan the vlan value to set. * @return the Subnet object itself. */ @@ -226,7 +232,7 @@ public Subnet withVlan(Integer vlan) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -234,4 +240,43 @@ public void validate() { 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 index d9ab517dca3d..35d2a78a4ff9 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * IPConfigurationReference - Describes a IPConfiguration under the virtual network. + */ @Fluent -public final class SubnetPropertiesFormatIpConfigurationReferencesItem { +public final class SubnetPropertiesFormatIpConfigurationReferencesItem + implements JsonSerializable { /* * IPConfigurationID */ - @JsonProperty(value = "ID") private String id; - /** Creates an instance of SubnetPropertiesFormatIpConfigurationReferencesItem class. */ + /** + * Creates an instance of SubnetPropertiesFormatIpConfigurationReferencesItem class. + */ public SubnetPropertiesFormatIpConfigurationReferencesItem() { } /** * Get the id property: IPConfigurationID. - * + * * @return the id value. */ public String id() { @@ -31,7 +39,7 @@ public String id() { /** * Set the id property: IPConfigurationID. - * + * * @param id the id value to set. * @return the SubnetPropertiesFormatIpConfigurationReferencesItem object itself. */ @@ -42,9 +50,47 @@ public SubnetPropertiesFormatIpConfigurationReferencesItem withId(String id) { /** * 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/UpdateList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java new file mode 100644 index 000000000000..76c2c2d6675b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.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.HciUpdateInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Updates. + */ +@Fluent +public final class UpdateList implements JsonSerializable { + /* + * List of Updates + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of UpdateList class. + */ + public UpdateList() { + } + + /** + * Get the value property: List of Updates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Updates. + * + * @param value the value value to set. + * @return the UpdateList object itself. + */ + public UpdateList 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 UpdateList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateList 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 UpdateList. + */ + public static UpdateList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateList deserializedUpdateList = new UpdateList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HciUpdateInner.fromJson(reader1)); + deserializedUpdateList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUpdateList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java new file mode 100644 index 000000000000..06aad1ef6391 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.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.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; + +/** + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before + * installing this update. Otherwise, it is empty. + */ +@Fluent +public final class UpdatePrerequisite implements JsonSerializable { + /* + * Updatable component type. + */ + private String updateType; + + /* + * Version of the prerequisite. + */ + private String version; + + /* + * Friendly name of the prerequisite. + */ + private String packageName; + + /** + * Creates an instance of UpdatePrerequisite class. + */ + public UpdatePrerequisite() { + } + + /** + * Get the updateType property: Updatable component type. + * + * @return the updateType value. + */ + public String updateType() { + return this.updateType; + } + + /** + * Set the updateType property: Updatable component type. + * + * @param updateType the updateType value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withUpdateType(String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Get the version property: Version of the prerequisite. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the prerequisite. + * + * @param version the version value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the packageName property: Friendly name of the prerequisite. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Set the packageName property: Friendly name of the prerequisite. + * + * @param packageName the packageName value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withPackageName(String packageName) { + this.packageName = packageName; + 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("updateType", this.updateType); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("packageName", this.packageName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdatePrerequisite from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdatePrerequisite 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 UpdatePrerequisite. + */ + public static UpdatePrerequisite fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdatePrerequisite deserializedUpdatePrerequisite = new UpdatePrerequisite(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("updateType".equals(fieldName)) { + deserializedUpdatePrerequisite.updateType = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedUpdatePrerequisite.version = reader.getString(); + } else if ("packageName".equals(fieldName)) { + deserializedUpdatePrerequisite.packageName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdatePrerequisite; + }); + } +} 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 new file mode 100644 index 000000000000..4d163de757e2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java @@ -0,0 +1,618 @@ +// Copyright (c) Microsoft Corporation. All rights 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.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of UpdateRun. + */ +public interface UpdateRun { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + OffsetDateTime timeStarted(); + + /** + * Gets the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + OffsetDateTime lastUpdatedTime(); + + /** + * Gets the duration property: Duration of the update run. + * + * @return the duration value. + */ + String duration(); + + /** + * Gets the state property: State of the update run. + * + * @return the state value. + */ + UpdateRunPropertiesState state(); + + /** + * Gets the namePropertiesName property: Name of the step. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the description property: More detailed description of the step. + * + * @return the description value. + */ + String description(); + + /** + * Gets the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + OffsetDateTime startTimeUtc(); + + /** + * Gets the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + OffsetDateTime endTimeUtc(); + + /** + * Gets the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + OffsetDateTime lastUpdatedTimeUtc(); + + /** + * Gets the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + List steps(); + + /** + * 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.UpdateRunInner object. + * + * @return the inner object. + */ + UpdateRunInner innerModel(); + + /** + * The entirety of the UpdateRun definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The UpdateRun definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the UpdateRun definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the UpdateRun definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, updateName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @return the next definition stage. + */ + WithCreate withExistingUpdate(String resourceGroupName, String clusterName, String updateName); + } + + /** + * The stage of the UpdateRun 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.WithTimeStarted, + DefinitionStages.WithLastUpdatedTime, DefinitionStages.WithDuration, DefinitionStages.WithState, + DefinitionStages.WithNamePropertiesName, DefinitionStages.WithDescription, + DefinitionStages.WithErrorMessage, DefinitionStages.WithStatus, DefinitionStages.WithStartTimeUtc, + DefinitionStages.WithEndTimeUtc, DefinitionStages.WithLastUpdatedTimeUtc, DefinitionStages.WithSteps { + /** + * Executes the create request. + * + * @return the created resource. + */ + UpdateRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + UpdateRun create(Context context); + } + + /** + * The stage of the UpdateRun 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. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the UpdateRun definition allowing to specify timeStarted. + */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + WithCreate withTimeStarted(OffsetDateTime timeStarted); + } + + /** + * The stage of the UpdateRun definition allowing to specify lastUpdatedTime. + */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + + /** + * The stage of the UpdateRun definition allowing to specify duration. + */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + WithCreate withDuration(String duration); + } + + /** + * The stage of the UpdateRun definition allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + WithCreate withState(UpdateRunPropertiesState state); + } + + /** + * The stage of the UpdateRun definition allowing to specify namePropertiesName. + */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + + /** + * The stage of the UpdateRun definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the UpdateRun definition allowing to specify errorMessage. + */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + WithCreate withErrorMessage(String errorMessage); + } + + /** + * The stage of the UpdateRun definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + WithCreate withStatus(String status); + } + + /** + * The stage of the UpdateRun definition allowing to specify startTimeUtc. + */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + WithCreate withStartTimeUtc(OffsetDateTime startTimeUtc); + } + + /** + * The stage of the UpdateRun definition allowing to specify endTimeUtc. + */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + WithCreate withEndTimeUtc(OffsetDateTime endTimeUtc); + } + + /** + * The stage of the UpdateRun definition allowing to specify lastUpdatedTimeUtc. + */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + + /** + * The stage of the UpdateRun definition allowing to specify steps. + */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + WithCreate withSteps(List steps); + } + } + + /** + * Begins update for the UpdateRun resource. + * + * @return the stage of resource update. + */ + UpdateRun.Update update(); + + /** + * The template for UpdateRun update. + */ + 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.WithSteps { + /** + * Executes the update request. + * + * @return the updated resource. + */ + UpdateRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + UpdateRun apply(Context context); + } + + /** + * The UpdateRun update stages. + */ + interface UpdateStages { + /** + * The stage of the UpdateRun update allowing to specify timeStarted. + */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + Update withTimeStarted(OffsetDateTime timeStarted); + } + + /** + * The stage of the UpdateRun update allowing to specify lastUpdatedTime. + */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + Update withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + + /** + * The stage of the UpdateRun update allowing to specify duration. + */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + Update withDuration(String duration); + } + + /** + * The stage of the UpdateRun update allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + Update withState(UpdateRunPropertiesState state); + } + + /** + * The stage of the UpdateRun update allowing to specify namePropertiesName. + */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + Update withNamePropertiesName(String namePropertiesName); + } + + /** + * The stage of the UpdateRun update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the UpdateRun update allowing to specify errorMessage. + */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + Update withErrorMessage(String errorMessage); + } + + /** + * The stage of the UpdateRun update allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + Update withStatus(String status); + } + + /** + * The stage of the UpdateRun update allowing to specify startTimeUtc. + */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + Update withStartTimeUtc(OffsetDateTime startTimeUtc); + } + + /** + * The stage of the UpdateRun update allowing to specify endTimeUtc. + */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + Update withEndTimeUtc(OffsetDateTime endTimeUtc); + } + + /** + * The stage of the UpdateRun update allowing to specify lastUpdatedTimeUtc. + */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + Update withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + + /** + * The stage of the UpdateRun update allowing to specify steps. + */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + Update withSteps(List steps); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + UpdateRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + UpdateRun refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java new file mode 100644 index 000000000000..f2606de6d457 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.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.UpdateRunInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Update runs. + */ +@Fluent +public final class UpdateRunList implements JsonSerializable { + /* + * List of Update runs + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of UpdateRunList class. + */ + public UpdateRunList() { + } + + /** + * Get the value property: List of Update runs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update runs. + * + * @param value the value value to set. + * @return the UpdateRunList object itself. + */ + public UpdateRunList 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 UpdateRunList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRunList 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 UpdateRunList. + */ + public static UpdateRunList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRunList deserializedUpdateRunList = new UpdateRunList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UpdateRunInner.fromJson(reader1)); + deserializedUpdateRunList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUpdateRunList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRunList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java new file mode 100644 index 000000000000..7bc017152f71 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** + * State of the update run. + */ +public final class UpdateRunPropertiesState extends ExpandableStringEnum { + /** + * Static value Unknown for UpdateRunPropertiesState. + */ + public static final UpdateRunPropertiesState UNKNOWN = fromString("Unknown"); + + /** + * Static value Succeeded for UpdateRunPropertiesState. + */ + public static final UpdateRunPropertiesState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value InProgress for UpdateRunPropertiesState. + */ + public static final UpdateRunPropertiesState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Failed for UpdateRunPropertiesState. + */ + public static final UpdateRunPropertiesState FAILED = fromString("Failed"); + + /** + * Creates a new instance of UpdateRunPropertiesState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateRunPropertiesState() { + } + + /** + * Creates or finds a UpdateRunPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRunPropertiesState. + */ + public static UpdateRunPropertiesState fromString(String name) { + return fromString(name, UpdateRunPropertiesState.class); + } + + /** + * Gets known UpdateRunPropertiesState values. + * + * @return known UpdateRunPropertiesState values. + */ + public static Collection values() { + return values(UpdateRunPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java new file mode 100644 index 000000000000..d64b5d6cb32d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of UpdateRuns. + */ +public interface UpdateRuns { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Get the Update run for a specified update. + * + * @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 Update run for a specified update along with {@link Response}. + */ + UpdateRun getById(String id); + + /** + * Get the Update run for a specified update. + * + * @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 Update run for a specified update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update Run. + * + * @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 specified Update Run. + * + * @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 UpdateRun resource. + * + * @param name resource name. + * @return the first stage of the new UpdateRun definition. + */ + UpdateRun.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 000000000000..8e4b4f3b2d55 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.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.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of UpdateSummaries. + */ +public interface UpdateSummaries { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + String oemFamily(); + + /** + * Gets the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + String hardwareModel(); + + /** + * Gets the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + List packageVersions(); + + /** + * Gets the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + String currentVersion(); + + /** + * Gets the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + OffsetDateTime lastUpdated(); + + /** + * Gets the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + OffsetDateTime lastChecked(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the state property: Overall update state of the stamp. + * + * @return the state value. + */ + UpdateSummariesPropertiesState state(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner object. + * + * @return the inner object. + */ + UpdateSummariesInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java new file mode 100644 index 000000000000..257e633d2bf3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.UpdateSummariesInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Update Summaries. + */ +@Fluent +public final class UpdateSummariesList implements JsonSerializable { + /* + * List of Update Summaries + */ + private List value; + + /* + * Link to the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of UpdateSummariesList class. + */ + public UpdateSummariesList() { + } + + /** + * Get the value property: List of Update Summaries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update Summaries. + * + * @param value the value value to set. + * @return the UpdateSummariesList object itself. + */ + public UpdateSummariesList 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 UpdateSummariesList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSummariesList 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 UpdateSummariesList. + */ + public static UpdateSummariesList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSummariesList deserializedUpdateSummariesList = new UpdateSummariesList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> UpdateSummariesInner.fromJson(reader1)); + deserializedUpdateSummariesList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUpdateSummariesList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSummariesList; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java new file mode 100644 index 000000000000..fe6b024f9799 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.UpdateSummariesInner; + +/** + * Resource collection API of UpdateSummariesOperations. + */ +public interface UpdateSummariesOperations { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + Response putWithResponse(String resourceGroupName, String clusterName, + UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + UpdateSummaries put(String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + UpdateSummaries get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java new file mode 100644 index 000000000000..74505e838bcf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Overall update state of the stamp. + */ +public final class UpdateSummariesPropertiesState extends ExpandableStringEnum { + /** + * Static value Unknown for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState UNKNOWN = fromString("Unknown"); + + /** + * Static value AppliedSuccessfully for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState APPLIED_SUCCESSFULLY = fromString("AppliedSuccessfully"); + + /** + * Static value UpdateAvailable for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState UPDATE_AVAILABLE = fromString("UpdateAvailable"); + + /** + * Static value UpdateInProgress for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState UPDATE_IN_PROGRESS = fromString("UpdateInProgress"); + + /** + * Static value UpdateFailed for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState UPDATE_FAILED = fromString("UpdateFailed"); + + /** + * Static value NeedsAttention for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Static value PreparationInProgress for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState PREPARATION_IN_PROGRESS = fromString("PreparationInProgress"); + + /** + * Static value PreparationFailed for UpdateSummariesPropertiesState. + */ + public static final UpdateSummariesPropertiesState PREPARATION_FAILED = fromString("PreparationFailed"); + + /** + * Creates a new instance of UpdateSummariesPropertiesState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateSummariesPropertiesState() { + } + + /** + * Creates or finds a UpdateSummariesPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateSummariesPropertiesState. + */ + public static UpdateSummariesPropertiesState fromString(String name) { + return fromString(name, UpdateSummariesPropertiesState.class); + } + + /** + * Gets known UpdateSummariesPropertiesState values. + * + * @return known UpdateSummariesPropertiesState values. + */ + public static Collection values() { + return values(UpdateSummariesPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java new file mode 100644 index 000000000000..39a3f88aa24a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights 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 Updates. + */ +public interface Updates { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String updateName, + Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + HciUpdate get(String resourceGroupName, String clusterName, String updateName); + + /** + * Get specified Update. + * + * @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 specified Update along with {@link Response}. + */ + HciUpdate getById(String id); + + /** + * Get specified Update. + * + * @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 specified Update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update. + * + * @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 specified Update. + * + * @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 HciUpdate resource. + * + * @param name resource name. + * @return the first stage of the new HciUpdate definition. + */ + HciUpdate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java new file mode 100644 index 000000000000..8587a4fd21cf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.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 UploadCertificateRequest model. + */ +@Fluent +public final class UploadCertificateRequest implements JsonSerializable { + /* + * The properties property. + */ + private RawCertificateData properties; + + /** + * Creates an instance of UploadCertificateRequest class. + */ + public UploadCertificateRequest() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public RawCertificateData properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withProperties(RawCertificateData properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UploadCertificateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UploadCertificateRequest 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 UploadCertificateRequest. + */ + public static UploadCertificateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UploadCertificateRequest deserializedUploadCertificateRequest = new UploadCertificateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedUploadCertificateRequest.properties = RawCertificateData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUploadCertificateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..7ab10d14760a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.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.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.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * 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 UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} 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 new file mode 100644 index 000000000000..411ce695606b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateRequest.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.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.util.List; + +/** + * The validate request for Edge Device. + */ +@Fluent +public final class ValidateRequest implements JsonSerializable { + /* + * Node Ids against which, current node has to be validated. + */ + private List edgeDeviceIds; + + /* + * additional Info required for validation + */ + private String additionalInfo; + + /** + * Creates an instance of ValidateRequest class. + */ + public ValidateRequest() { + } + + /** + * Get the edgeDeviceIds property: Node Ids against which, current node has to be validated. + * + * @return the edgeDeviceIds value. + */ + public List edgeDeviceIds() { + return this.edgeDeviceIds; + } + + /** + * Set the edgeDeviceIds property: Node Ids against which, current node has to be validated. + * + * @param edgeDeviceIds the edgeDeviceIds value to set. + * @return the ValidateRequest object itself. + */ + public ValidateRequest withEdgeDeviceIds(List edgeDeviceIds) { + this.edgeDeviceIds = edgeDeviceIds; + return this; + } + + /** + * Get the additionalInfo property: additional Info required for validation. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * Set the additionalInfo property: additional Info required for validation. + * + * @param additionalInfo the additionalInfo value to set. + * @return the ValidateRequest object itself. + */ + public ValidateRequest withAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (edgeDeviceIds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property edgeDeviceIds in model ValidateRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("edgeDeviceIds", this.edgeDeviceIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("additionalInfo", this.additionalInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateRequest 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 ValidateRequest. + */ + public static ValidateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateRequest deserializedValidateRequest = new ValidateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edgeDeviceIds".equals(fieldName)) { + List edgeDeviceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedValidateRequest.edgeDeviceIds = edgeDeviceIds; + } else if ("additionalInfo".equals(fieldName)) { + deserializedValidateRequest.additionalInfo = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateRequest; + }); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateResponse.java new file mode 100644 index 000000000000..87ae7b302847 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ValidateResponse.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.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner; + +/** + * An immutable client-side representation of ValidateResponse. + */ +public interface ValidateResponse { + /** + * Gets the status property: edge device validation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ValidateResponseInner object. + * + * @return the inner object. + */ + ValidateResponseInner innerModel(); +} 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 index c704c8114b5b..f0c99ae74104 100644 --- 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 @@ -5,36 +5,41 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The observed state of virtual hard disks. + */ @Fluent -public final class VirtualHardDiskStatus { +public final class VirtualHardDiskStatus implements JsonSerializable { /* * VirtualHardDisk provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private VirtualHardDiskStatusProvisioningStatus provisioningStatus; - /** Creates an instance of VirtualHardDiskStatus class. */ + /** + * Creates an instance of VirtualHardDiskStatus class. + */ public VirtualHardDiskStatus() { } /** * Get the errorCode property: VirtualHardDisk provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -43,7 +48,7 @@ public String errorCode() { /** * Set the errorCode property: VirtualHardDisk provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the VirtualHardDiskStatus object itself. */ @@ -54,7 +59,7 @@ public VirtualHardDiskStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -63,7 +68,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the VirtualHardDiskStatus object itself. */ @@ -74,7 +79,7 @@ public VirtualHardDiskStatus withErrorMessage(String errorMessage) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public VirtualHardDiskStatusProvisioningStatus provisioningStatus() { @@ -83,7 +88,7 @@ public VirtualHardDiskStatusProvisioningStatus provisioningStatus() { /** * Set the provisioningStatus property: The provisioningStatus property. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the VirtualHardDiskStatus object itself. */ @@ -94,7 +99,7 @@ public VirtualHardDiskStatus withProvisioningStatus(VirtualHardDiskStatusProvisi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -102,4 +107,47 @@ public void validate() { 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 index f3290352a0f5..7383c5dc2905 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualHardDiskStatusProvisioningStatus model. + */ @Fluent -public final class VirtualHardDiskStatusProvisioningStatus { +public final class VirtualHardDiskStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the virtual hard disk */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the virtual hard disk [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of VirtualHardDiskStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public VirtualHardDiskStatusProvisioningStatus withOperationId(String operationI /** * 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() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,49 @@ public VirtualHardDiskStatusProvisioningStatus withStatus(Status status) { /** * 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 index b9559b354061..7dee31fa9b1d 100644 --- 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 @@ -10,174 +10,181 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner; import java.util.Map; -/** An immutable client-side representation of VirtualHardDisks. */ +/** + * 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 entirety of the VirtualHardDisks definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The VirtualHardDisks definition stages. */ + /** + * The VirtualHardDisks definition stages. + */ interface DefinitionStages { - /** The first stage of the VirtualHardDisks definition. */ + /** + * The first stage of the VirtualHardDisks definition. + */ interface Blank extends WithLocation { } - /** The stage of the VirtualHardDisks definition allowing to specify location. */ + /** + * 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. */ @@ -185,18 +192,20 @@ interface WithLocation { /** * 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. */ + /** + * 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. */ @@ -207,137 +216,151 @@ interface WithResourceGroup { * 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 { + 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ @@ -347,36 +370,42 @@ interface WithContainerId { /** * Begins update for the VirtualHardDisks resource. - * + * * @return the stage of resource update. */ VirtualHardDisks.Update update(); - /** The template for VirtualHardDisks 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. */ + /** + * The VirtualHardDisks update stages. + */ interface UpdateStages { - /** The stage of the VirtualHardDisks update allowing to specify tags. */ + /** + * 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. */ @@ -386,14 +415,14 @@ interface WithTags { /** * 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. */ 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 index ef85352a516b..7689169d4a1b 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The VirtualHardDisksListResult model. */ +/** + * The VirtualHardDisksListResult model. + */ @Fluent -public final class VirtualHardDisksListResult { +public final class VirtualHardDisksListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of VirtualHardDisksListResult class. */ + /** + * Creates an instance of VirtualHardDisksListResult class. + */ public VirtualHardDisksListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the VirtualHardDisksListResult object itself. */ @@ -50,7 +56,7 @@ public VirtualHardDisksListResult withValue(List value) { /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The nextLink property. - * + * * @param nextLink the nextLink value to set. * @return the VirtualHardDisksListResult object itself. */ @@ -70,7 +76,7 @@ public VirtualHardDisksListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { 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 index 431d46dc766a..d4be8cbb4337 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VirtualHardDisksOperations. */ +/** + * 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. @@ -21,12 +23,12 @@ public interface VirtualHardDisksOperations { * @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); + 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -49,7 +51,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -74,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * 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}. @@ -97,7 +99,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -108,7 +110,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -131,7 +133,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -141,7 +143,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -152,7 +154,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new VirtualHardDisks resource. - * + * * @param name resource name. * @return the first stage of the new VirtualHardDisks definition. */ 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 index f82a434c0b2b..7265dd0a484d 100644 --- 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 @@ -5,27 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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. */ +/** + * The virtual hard disk resource patch definition. + */ @Fluent -public final class VirtualHardDisksUpdateRequest { +public final class VirtualHardDisksUpdateRequest implements JsonSerializable { /* * Resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of VirtualHardDisksUpdateRequest class. */ + /** + * Creates an instance of VirtualHardDisksUpdateRequest class. + */ public VirtualHardDisksUpdateRequest() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the VirtualHardDisksUpdateRequest object itself. */ @@ -45,9 +50,47 @@ public VirtualHardDisksUpdateRequest withTags(Map tags) { /** * 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 index 4a792291bf47..d2328c173c13 100644 --- 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 @@ -5,31 +5,38 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The instance view of the VM Config Agent running on the virtual machine. + */ @Fluent -public final class VirtualMachineConfigAgentInstanceView { +public final class VirtualMachineConfigAgentInstanceView + implements JsonSerializable { /* * The VM Config Agent full version. */ - @JsonProperty(value = "vmConfigAgentVersion") private String vmConfigAgentVersion; /* * The resource status information. */ - @JsonProperty(value = "statuses") private List statuses; - /** Creates an instance of VirtualMachineConfigAgentInstanceView class. */ + /** + * 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() { @@ -38,7 +45,7 @@ public String vmConfigAgentVersion() { /** * Set the vmConfigAgentVersion property: The VM Config Agent full version. - * + * * @param vmConfigAgentVersion the vmConfigAgentVersion value to set. * @return the VirtualMachineConfigAgentInstanceView object itself. */ @@ -49,7 +56,7 @@ public VirtualMachineConfigAgentInstanceView withVmConfigAgentVersion(String vmC /** * Get the statuses property: The resource status information. - * + * * @return the statuses value. */ public List statuses() { @@ -58,7 +65,7 @@ public List statuses() { /** * Set the statuses property: The resource status information. - * + * * @param statuses the statuses value to set. * @return the VirtualMachineConfigAgentInstanceView object itself. */ @@ -69,7 +76,7 @@ public VirtualMachineConfigAgentInstanceView withStatuses(List 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 index 0e31153fa886..00ad077edfa5 100644 --- 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 @@ -7,46 +7,48 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; -/** An immutable client-side representation of VirtualMachineInstance. */ +/** + * 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(); @@ -54,7 +56,7 @@ public interface VirtualMachineInstance { /** * Gets the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine * instance. - * + * * @return the hardwareProfile value. */ VirtualMachineInstancePropertiesHardwareProfile hardwareProfile(); @@ -62,14 +64,14 @@ public interface VirtualMachineInstance { /** * 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(); @@ -77,7 +79,7 @@ public interface VirtualMachineInstance { /** * Gets the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine * instance. - * + * * @return the securityProfile value. */ VirtualMachineInstancePropertiesSecurityProfile securityProfile(); @@ -85,63 +87,63 @@ public interface VirtualMachineInstance { /** * 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 index b559c3387009..b3a290c4172b 100644 --- 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 @@ -5,32 +5,38 @@ 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 com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The VirtualMachineInstanceListResult model. */ +/** + * The VirtualMachineInstanceListResult model. + */ @Fluent -public final class VirtualMachineInstanceListResult { +public final class VirtualMachineInstanceListResult implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of VirtualMachineInstanceListResult class. */ + /** + * Creates an instance of VirtualMachineInstanceListResult class. + */ public VirtualMachineInstanceListResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the VirtualMachineInstanceListResult object itself. */ @@ -50,7 +56,7 @@ public VirtualMachineInstanceListResult withValue(List 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 index 309970529216..ee7987cc974c 100644 --- 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 @@ -5,42 +5,47 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ +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 { +public final class VirtualMachineInstancePropertiesHardwareProfile + implements JsonSerializable { /* * The vmSize property. */ - @JsonProperty(value = "vmSize") private VmSizeEnum vmSize; /* * number of processors for the virtual machine instance */ - @JsonProperty(value = "processors") private Integer processors; /* * RAM in MB for the virtual machine instance */ - @JsonProperty(value = "memoryMB") private Long memoryMB; /* * The dynamicMemoryConfig property. */ - @JsonProperty(value = "dynamicMemoryConfig") private VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig; - /** Creates an instance of VirtualMachineInstancePropertiesHardwareProfile class. */ + /** + * Creates an instance of VirtualMachineInstancePropertiesHardwareProfile class. + */ public VirtualMachineInstancePropertiesHardwareProfile() { } /** * Get the vmSize property: The vmSize property. - * + * * @return the vmSize value. */ public VmSizeEnum vmSize() { @@ -49,7 +54,7 @@ public VmSizeEnum vmSize() { /** * Set the vmSize property: The vmSize property. - * + * * @param vmSize the vmSize value to set. * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. */ @@ -60,7 +65,7 @@ public VirtualMachineInstancePropertiesHardwareProfile withVmSize(VmSizeEnum vmS /** * Get the processors property: number of processors for the virtual machine instance. - * + * * @return the processors value. */ public Integer processors() { @@ -69,7 +74,7 @@ public Integer 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. */ @@ -80,7 +85,7 @@ public VirtualMachineInstancePropertiesHardwareProfile withProcessors(Integer pr /** * Get the memoryMB property: RAM in MB for the virtual machine instance. - * + * * @return the memoryMB value. */ public Long memoryMB() { @@ -89,7 +94,7 @@ public Long 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. */ @@ -100,7 +105,7 @@ public VirtualMachineInstancePropertiesHardwareProfile withMemoryMB(Long memoryM /** * Get the dynamicMemoryConfig property: The dynamicMemoryConfig property. - * + * * @return the dynamicMemoryConfig value. */ public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig() { @@ -109,7 +114,7 @@ public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig dynami /** * Set the dynamicMemoryConfig property: The dynamicMemoryConfig property. - * + * * @param dynamicMemoryConfig the dynamicMemoryConfig value to set. * @return the VirtualMachineInstancePropertiesHardwareProfile object itself. */ @@ -121,7 +126,7 @@ public VirtualMachineInstancePropertiesHardwareProfile withDynamicMemoryConfig( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -129,4 +134,54 @@ public void validate() { 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 index 2da79987e8af..ae46f25175ea 100644 --- 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 @@ -5,38 +5,44 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig model. + */ @Fluent -public final class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { +public final class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + implements JsonSerializable { /* * The maximumMemoryMB property. */ - @JsonProperty(value = "maximumMemoryMB") private Long maximumMemoryMB; /* * The minimumMemoryMB property. */ - @JsonProperty(value = "minimumMemoryMB") private Long minimumMemoryMB; /* * Defines the amount of extra memory that should be reserved for a virtual machine instance at runtime, as a - * percentage of the total memory that the virtual machine instance is thought to need. This only applies to - * virtual systems with dynamic memory enabled. This property can be in the range of 5 to 2000. + * percentage of the total memory that the virtual machine instance is thought to need. This only applies to virtual + * systems with dynamic memory enabled. This property can be in the range of 5 to 2000. */ - @JsonProperty(value = "targetMemoryBuffer") private Integer targetMemoryBuffer; - /** Creates an instance of VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig class. */ + /** + * Creates an instance of VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig class. + */ public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig() { } /** * Get the maximumMemoryMB property: The maximumMemoryMB property. - * + * * @return the maximumMemoryMB value. */ public Long maximumMemoryMB() { @@ -45,19 +51,19 @@ public Long 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) { + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + withMaximumMemoryMB(Long maximumMemoryMB) { this.maximumMemoryMB = maximumMemoryMB; return this; } /** * Get the minimumMemoryMB property: The minimumMemoryMB property. - * + * * @return the minimumMemoryMB value. */ public Long minimumMemoryMB() { @@ -66,12 +72,12 @@ public Long 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) { + public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + withMinimumMemoryMB(Long minimumMemoryMB) { this.minimumMemoryMB = minimumMemoryMB; return this; } @@ -81,7 +87,7 @@ public VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig withMi * 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() { @@ -93,21 +99,69 @@ public Integer targetMemoryBuffer() { * 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) { + 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 index 85189f9c5391..87b67fd407e8 100644 --- 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 @@ -5,26 +5,34 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * NetworkProfile - describes the network configuration the virtual machine instance. + */ @Fluent -public final class VirtualMachineInstancePropertiesNetworkProfile { +public final class VirtualMachineInstancePropertiesNetworkProfile + implements JsonSerializable { /* * NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance */ - @JsonProperty(value = "networkInterfaces") private List networkInterfaces; - /** Creates an instance of VirtualMachineInstancePropertiesNetworkProfile class. */ + /** + * 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() { @@ -34,7 +42,7 @@ public List /** * 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. */ @@ -46,7 +54,7 @@ public VirtualMachineInstancePropertiesNetworkProfile withNetworkInterfaces( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -54,4 +62,45 @@ public void validate() { 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 index f4699a166e1f..51e9ec97b0d1 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem model. + */ @Fluent -public final class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem { +public final class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem + implements JsonSerializable { /* * ID - Resource Id of the network interface */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem class. */ + /** + * 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() { @@ -31,7 +39,7 @@ public String id() { /** * Set the id property: ID - Resource Id of the network interface. - * + * * @param id the id value to set. * @return the VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem object itself. */ @@ -42,9 +50,49 @@ public VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem withI /** * 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 index bf1a7840475d..2a53d8e14b60 100644 --- 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 @@ -5,48 +5,52 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** OsProfile - describes the configuration of the operating system and sets login data. */ +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 { +public final class VirtualMachineInstancePropertiesOsProfile + implements JsonSerializable { /* * AdminPassword - admin password */ - @JsonProperty(value = "adminPassword") private String adminPassword; /* * AdminUsername - admin username */ - @JsonProperty(value = "adminUsername") private String adminUsername; /* * ComputerName - name of the compute */ - @JsonProperty(value = "computerName") private String computerName; /* * LinuxConfiguration - linux specific configuration values for the virtual machine instance */ - @JsonProperty(value = "linuxConfiguration") private VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration; /* * Windows Configuration for the virtual machine instance */ - @JsonProperty(value = "windowsConfiguration") private VirtualMachineInstancePropertiesOsProfileWindowsConfiguration windowsConfiguration; - /** Creates an instance of VirtualMachineInstancePropertiesOsProfile class. */ + /** + * Creates an instance of VirtualMachineInstancePropertiesOsProfile class. + */ public VirtualMachineInstancePropertiesOsProfile() { } /** * Get the adminPassword property: AdminPassword - admin password. - * + * * @return the adminPassword value. */ public String adminPassword() { @@ -55,7 +59,7 @@ public String adminPassword() { /** * Set the adminPassword property: AdminPassword - admin password. - * + * * @param adminPassword the adminPassword value to set. * @return the VirtualMachineInstancePropertiesOsProfile object itself. */ @@ -66,7 +70,7 @@ public VirtualMachineInstancePropertiesOsProfile withAdminPassword(String adminP /** * Get the adminUsername property: AdminUsername - admin username. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -75,7 +79,7 @@ public String adminUsername() { /** * Set the adminUsername property: AdminUsername - admin username. - * + * * @param adminUsername the adminUsername value to set. * @return the VirtualMachineInstancePropertiesOsProfile object itself. */ @@ -86,7 +90,7 @@ public VirtualMachineInstancePropertiesOsProfile withAdminUsername(String adminU /** * Get the computerName property: ComputerName - name of the compute. - * + * * @return the computerName value. */ public String computerName() { @@ -95,7 +99,7 @@ public String computerName() { /** * Set the computerName property: ComputerName - name of the compute. - * + * * @param computerName the computerName value to set. * @return the VirtualMachineInstancePropertiesOsProfile object itself. */ @@ -107,7 +111,7 @@ public VirtualMachineInstancePropertiesOsProfile withComputerName(String compute /** * Get the linuxConfiguration property: LinuxConfiguration - linux specific configuration values for the virtual * machine instance. - * + * * @return the linuxConfiguration value. */ public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfiguration() { @@ -117,19 +121,19 @@ public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration linuxConfigur /** * 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) { + 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() { @@ -138,19 +142,19 @@ public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration windowsConf /** * 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) { + 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() { @@ -161,4 +165,55 @@ public void validate() { 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 index ec12bb03ccb7..12a15a78a734 100644 --- 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 @@ -5,44 +5,49 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** LinuxConfiguration - linux specific configuration values for the virtual machine instance. */ +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 { +public final class VirtualMachineInstancePropertiesOsProfileLinuxConfiguration + implements JsonSerializable { /* * DisablePasswordAuthentication - whether password authentication should be disabled */ - @JsonProperty(value = "disablePasswordAuthentication") private Boolean disablePasswordAuthentication; /* * Specifies the ssh key configuration for a Linux OS. */ - @JsonProperty(value = "ssh") private SshConfiguration ssh; /* - * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine - * instance creation process. + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. */ - @JsonProperty(value = "provisionVMAgent") private Boolean provisionVMAgent; /* * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ - @JsonProperty(value = "provisionVMConfigAgent") private Boolean provisionVMConfigAgent; - /** Creates an instance of VirtualMachineInstancePropertiesOsProfileLinuxConfiguration class. */ + /** + * 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() { @@ -52,19 +57,19 @@ public Boolean 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) { + 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() { @@ -73,7 +78,7 @@ public SshConfiguration 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. */ @@ -85,7 +90,7 @@ public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withSsh(SshCo /** * 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() { @@ -95,7 +100,7 @@ public Boolean 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. */ @@ -107,7 +112,7 @@ public VirtualMachineInstancePropertiesOsProfileLinuxConfiguration withProvision /** * 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() { @@ -117,19 +122,19 @@ public Boolean 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) { + 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() { @@ -137,4 +142,56 @@ public void validate() { 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 index f57a8d5b4648..4ebb3d13c51d 100644 --- 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 @@ -5,49 +5,53 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Windows Configuration for the virtual machine instance. */ +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 { +public final class VirtualMachineInstancePropertiesOsProfileWindowsConfiguration + implements JsonSerializable { /* * Whether to EnableAutomaticUpdates on the machine */ - @JsonProperty(value = "enableAutomaticUpdates") private Boolean enableAutomaticUpdates; /* * Specifies the ssh key configuration for Windows OS. */ - @JsonProperty(value = "ssh") private SshConfiguration ssh; /* * TimeZone for the virtual machine instance */ - @JsonProperty(value = "timeZone") private String timeZone; /* - * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine - * instance creation process. + * Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance + * creation process. */ - @JsonProperty(value = "provisionVMAgent") private Boolean provisionVMAgent; /* * Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ - @JsonProperty(value = "provisionVMConfigAgent") private Boolean provisionVMConfigAgent; - /** Creates an instance of VirtualMachineInstancePropertiesOsProfileWindowsConfiguration class. */ + /** + * 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() { @@ -56,19 +60,19 @@ public Boolean 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) { + 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() { @@ -77,7 +81,7 @@ public SshConfiguration 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. */ @@ -88,7 +92,7 @@ public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withSsh(Ssh /** * Get the timeZone property: TimeZone for the virtual machine instance. - * + * * @return the timeZone value. */ public String timeZone() { @@ -97,7 +101,7 @@ public String timeZone() { /** * Set the timeZone property: TimeZone for the virtual machine instance. - * + * * @param timeZone the timeZone value to set. * @return the VirtualMachineInstancePropertiesOsProfileWindowsConfiguration object itself. */ @@ -109,7 +113,7 @@ public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withTimeZon /** * 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() { @@ -119,12 +123,12 @@ public Boolean 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) { + public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration + withProvisionVMAgent(Boolean provisionVMAgent) { this.provisionVMAgent = provisionVMAgent; return this; } @@ -132,7 +136,7 @@ public VirtualMachineInstancePropertiesOsProfileWindowsConfiguration withProvisi /** * 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() { @@ -142,19 +146,19 @@ public Boolean 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) { + 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() { @@ -162,4 +166,60 @@ public void validate() { 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 index 6901104c8153..21ede0f32569 100644 --- 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 @@ -5,37 +5,43 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * SecurityProfile - Specifies the security settings for the virtual machine instance. + */ @Fluent -public final class VirtualMachineInstancePropertiesSecurityProfile { +public final class VirtualMachineInstancePropertiesSecurityProfile + implements JsonSerializable { /* * The enableTPM property. */ - @JsonProperty(value = "enableTPM") private Boolean enableTpm; /* * The uefiSettings property. */ - @JsonProperty(value = "uefiSettings") private VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings; /* * Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for * SecurityType to function. */ - @JsonProperty(value = "securityType") private SecurityTypes securityType; - /** Creates an instance of VirtualMachineInstancePropertiesSecurityProfile class. */ + /** + * Creates an instance of VirtualMachineInstancePropertiesSecurityProfile class. + */ public VirtualMachineInstancePropertiesSecurityProfile() { } /** * Get the enableTpm property: The enableTPM property. - * + * * @return the enableTpm value. */ public Boolean enableTpm() { @@ -44,7 +50,7 @@ public Boolean enableTpm() { /** * Set the enableTpm property: The enableTPM property. - * + * * @param enableTpm the enableTpm value to set. * @return the VirtualMachineInstancePropertiesSecurityProfile object itself. */ @@ -55,7 +61,7 @@ public VirtualMachineInstancePropertiesSecurityProfile withEnableTpm(Boolean ena /** * Get the uefiSettings property: The uefiSettings property. - * + * * @return the uefiSettings value. */ public VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings() { @@ -64,12 +70,12 @@ public VirtualMachineInstancePropertiesSecurityProfileUefiSettings 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) { + public VirtualMachineInstancePropertiesSecurityProfile + withUefiSettings(VirtualMachineInstancePropertiesSecurityProfileUefiSettings uefiSettings) { this.uefiSettings = uefiSettings; return this; } @@ -77,7 +83,7 @@ public VirtualMachineInstancePropertiesSecurityProfile withUefiSettings( /** * 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() { @@ -87,7 +93,7 @@ public SecurityTypes 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. */ @@ -98,7 +104,7 @@ public VirtualMachineInstancePropertiesSecurityProfile withSecurityType(Security /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -106,4 +112,50 @@ public void validate() { 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 index 5416dd903191..2cce2f90e06c 100644 --- 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 @@ -5,25 +5,33 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualMachineInstancePropertiesSecurityProfileUefiSettings model. + */ @Fluent -public final class VirtualMachineInstancePropertiesSecurityProfileUefiSettings { +public final class VirtualMachineInstancePropertiesSecurityProfileUefiSettings + implements JsonSerializable { /* * Specifies whether secure boot should be enabled on the virtual machine instance. */ - @JsonProperty(value = "secureBootEnabled") private Boolean secureBootEnabled; - /** Creates an instance of VirtualMachineInstancePropertiesSecurityProfileUefiSettings class. */ + /** + * 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() { @@ -33,21 +41,61 @@ public Boolean 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) { + 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 index 8a2ff43897df..b877525c5218 100644 --- 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 @@ -5,43 +5,48 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * StorageProfile - contains information about the disks and storage information for the virtual machine instance. + */ @Fluent -public final class VirtualMachineInstancePropertiesStorageProfile { +public final class VirtualMachineInstancePropertiesStorageProfile + implements JsonSerializable { /* * adds data disks to the virtual machine instance */ - @JsonProperty(value = "dataDisks") private List dataDisks; /* * Which Image to use for the virtual machine instance */ - @JsonProperty(value = "imageReference") private VirtualMachineInstancePropertiesStorageProfileImageReference imageReference; /* * VHD to attach as OS disk */ - @JsonProperty(value = "osDisk") private VirtualMachineInstancePropertiesStorageProfileOsDisk osDisk; /* * Id of the storage container that hosts the VM configuration file */ - @JsonProperty(value = "vmConfigStoragePathId") private String vmConfigStoragePathId; - /** Creates an instance of VirtualMachineInstancePropertiesStorageProfile class. */ + /** + * 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() { @@ -50,19 +55,19 @@ public List dataDis /** * 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) { + 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() { @@ -71,19 +76,19 @@ public VirtualMachineInstancePropertiesStorageProfileImageReference imageReferen /** * 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) { + 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() { @@ -92,19 +97,19 @@ public VirtualMachineInstancePropertiesStorageProfileOsDisk 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) { + 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() { @@ -113,7 +118,7 @@ public String 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. */ @@ -124,7 +129,7 @@ public VirtualMachineInstancePropertiesStorageProfile withVmConfigStoragePathId( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -138,4 +143,55 @@ public void validate() { 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 index f51f94fb44f5..b0135c89cf7a 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualMachineInstancePropertiesStorageProfileDataDisksItem model. + */ @Fluent -public final class VirtualMachineInstancePropertiesStorageProfileDataDisksItem { +public final class VirtualMachineInstancePropertiesStorageProfileDataDisksItem + implements JsonSerializable { /* * Resource ID of the data disk */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileDataDisksItem class. */ + /** + * 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() { @@ -31,7 +39,7 @@ public String id() { /** * Set the id property: Resource ID of the data disk. - * + * * @param id the id value to set. * @return the VirtualMachineInstancePropertiesStorageProfileDataDisksItem object itself. */ @@ -42,9 +50,48 @@ public VirtualMachineInstancePropertiesStorageProfileDataDisksItem withId(String /** * 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 index f9a099ce28a4..499e02d1f238 100644 --- 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 @@ -5,24 +5,32 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * Which Image to use for the virtual machine instance. + */ @Fluent -public final class VirtualMachineInstancePropertiesStorageProfileImageReference { +public final class VirtualMachineInstancePropertiesStorageProfileImageReference + implements JsonSerializable { /* * Resource ID of the image */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileImageReference class. */ + /** + * Creates an instance of VirtualMachineInstancePropertiesStorageProfileImageReference class. + */ public VirtualMachineInstancePropertiesStorageProfileImageReference() { } /** * Get the id property: Resource ID of the image. - * + * * @return the id value. */ public String id() { @@ -31,7 +39,7 @@ public String id() { /** * Set the id property: Resource ID of the image. - * + * * @param id the id value to set. * @return the VirtualMachineInstancePropertiesStorageProfileImageReference object itself. */ @@ -42,9 +50,48 @@ public VirtualMachineInstancePropertiesStorageProfileImageReference withId(Strin /** * 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 index 9e7571961f62..fdb8fab872a6 100644 --- 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 @@ -5,31 +5,38 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * VHD to attach as OS disk. + */ @Fluent -public final class VirtualMachineInstancePropertiesStorageProfileOsDisk { +public final class VirtualMachineInstancePropertiesStorageProfileOsDisk + implements JsonSerializable { /* * Resource ID of the OS disk */ - @JsonProperty(value = "id") private String id; /* * This property allows you to specify the type of the OS that is included in the disk if creating a VM from * user-image or a specialized VHD. Possible values are: **Windows,** **Linux.** */ - @JsonProperty(value = "osType") private OperatingSystemTypes osType; - /** Creates an instance of VirtualMachineInstancePropertiesStorageProfileOsDisk class. */ + /** + * 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() { @@ -38,7 +45,7 @@ public String id() { /** * Set the id property: Resource ID of the OS disk. - * + * * @param id the id value to set. * @return the VirtualMachineInstancePropertiesStorageProfileOsDisk object itself. */ @@ -50,7 +57,7 @@ public VirtualMachineInstancePropertiesStorageProfileOsDisk withId(String id) { /** * 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() { @@ -60,7 +67,7 @@ public OperatingSystemTypes 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. */ @@ -71,9 +78,51 @@ public VirtualMachineInstancePropertiesStorageProfileOsDisk withOsType(Operating /** * 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 index c3ba6d850df9..fac60d01a6e5 100644 --- 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 @@ -5,42 +5,46 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The observed state of virtual machine instances. */ +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 { +public final class VirtualMachineInstanceStatus implements JsonSerializable { /* * VirtualMachine provisioning error code */ - @JsonProperty(value = "errorCode") private String errorCode; /* * Descriptive error message */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The power state of the virtual machine instance */ - @JsonProperty(value = "powerState") private PowerStateEnum powerState; /* * The provisioningStatus property. */ - @JsonProperty(value = "provisioningStatus") private VirtualMachineInstanceStatusProvisioningStatus provisioningStatus; - /** Creates an instance of VirtualMachineInstanceStatus class. */ + /** + * Creates an instance of VirtualMachineInstanceStatus class. + */ public VirtualMachineInstanceStatus() { } /** * Get the errorCode property: VirtualMachine provisioning error code. - * + * * @return the errorCode value. */ public String errorCode() { @@ -49,7 +53,7 @@ public String errorCode() { /** * Set the errorCode property: VirtualMachine provisioning error code. - * + * * @param errorCode the errorCode value to set. * @return the VirtualMachineInstanceStatus object itself. */ @@ -60,7 +64,7 @@ public VirtualMachineInstanceStatus withErrorCode(String errorCode) { /** * Get the errorMessage property: Descriptive error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -69,7 +73,7 @@ public String errorMessage() { /** * Set the errorMessage property: Descriptive error message. - * + * * @param errorMessage the errorMessage value to set. * @return the VirtualMachineInstanceStatus object itself. */ @@ -80,7 +84,7 @@ public VirtualMachineInstanceStatus withErrorMessage(String errorMessage) { /** * Get the powerState property: The power state of the virtual machine instance. - * + * * @return the powerState value. */ public PowerStateEnum powerState() { @@ -89,7 +93,7 @@ public PowerStateEnum 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. */ @@ -100,7 +104,7 @@ public VirtualMachineInstanceStatus withPowerState(PowerStateEnum powerState) { /** * Get the provisioningStatus property: The provisioningStatus property. - * + * * @return the provisioningStatus value. */ public VirtualMachineInstanceStatusProvisioningStatus provisioningStatus() { @@ -109,19 +113,19 @@ public VirtualMachineInstanceStatusProvisioningStatus 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) { + 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() { @@ -129,4 +133,50 @@ public void validate() { 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 index ed458095d1c7..9b3ce5c3cf3b 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The VirtualMachineInstanceStatusProvisioningStatus model. + */ @Fluent -public final class VirtualMachineInstanceStatusProvisioningStatus { +public final class VirtualMachineInstanceStatusProvisioningStatus + implements JsonSerializable { /* * The ID of the operation performed on the virtual machine instance */ - @JsonProperty(value = "operationId") private String operationId; /* * The status of the operation performed on the virtual machine instance [Succeeded, Failed, InProgress] */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of VirtualMachineInstanceStatusProvisioningStatus class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public String 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. */ @@ -49,7 +56,7 @@ public VirtualMachineInstanceStatusProvisioningStatus withOperationId(String ope /** * 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() { @@ -59,7 +66,7 @@ public Status 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. */ @@ -70,9 +77,50 @@ public VirtualMachineInstanceStatusProvisioningStatus withStatus(Status status) /** * 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 index bcd3277ff094..1266146dc683 100644 --- 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 @@ -5,43 +5,48 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the resource properties for the update. */ +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 { +public final class VirtualMachineInstanceUpdateProperties + implements JsonSerializable { /* * HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ - @JsonProperty(value = "hardwareProfile") private HardwareProfileUpdate hardwareProfile; /* * The storageProfile property. */ - @JsonProperty(value = "storageProfile") private StorageProfileUpdate storageProfile; /* * NetworkProfile - describes the network update configuration the virtual machine instance */ - @JsonProperty(value = "networkProfile") private NetworkProfileUpdate networkProfile; /* * OsProfile - describes the update configuration of the operating system */ - @JsonProperty(value = "osProfile") private OsProfileUpdate osProfile; - /** Creates an instance of VirtualMachineInstanceUpdateProperties class. */ + /** + * 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() { @@ -51,7 +56,7 @@ public HardwareProfileUpdate 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. */ @@ -62,7 +67,7 @@ public VirtualMachineInstanceUpdateProperties withHardwareProfile(HardwareProfil /** * Get the storageProfile property: The storageProfile property. - * + * * @return the storageProfile value. */ public StorageProfileUpdate storageProfile() { @@ -71,7 +76,7 @@ public StorageProfileUpdate storageProfile() { /** * Set the storageProfile property: The storageProfile property. - * + * * @param storageProfile the storageProfile value to set. * @return the VirtualMachineInstanceUpdateProperties object itself. */ @@ -83,7 +88,7 @@ public VirtualMachineInstanceUpdateProperties withStorageProfile(StorageProfileU /** * Get the networkProfile property: NetworkProfile - describes the network update configuration the virtual machine * instance. - * + * * @return the networkProfile value. */ public NetworkProfileUpdate networkProfile() { @@ -93,7 +98,7 @@ public NetworkProfileUpdate 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. */ @@ -104,7 +109,7 @@ public VirtualMachineInstanceUpdateProperties withNetworkProfile(NetworkProfileU /** * Get the osProfile property: OsProfile - describes the update configuration of the operating system. - * + * * @return the osProfile value. */ public OsProfileUpdate osProfile() { @@ -113,7 +118,7 @@ public OsProfileUpdate 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. */ @@ -124,7 +129,7 @@ public VirtualMachineInstanceUpdateProperties withOsProfile(OsProfileUpdate osPr /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -141,4 +146,53 @@ public void validate() { 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 index 5070e3dfca44..eedfe4fc2b82 100644 --- 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 @@ -5,30 +5,37 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The virtual machine instance resource patch definition. + */ @Fluent -public final class VirtualMachineInstanceUpdateRequest { +public final class VirtualMachineInstanceUpdateRequest + implements JsonSerializable { /* * Defines the resource properties for the update. */ - @JsonProperty(value = "properties") private VirtualMachineInstanceUpdateProperties properties; /* * Identity for the resource. */ - @JsonProperty(value = "identity") private Identity identity; - /** Creates an instance of VirtualMachineInstanceUpdateRequest class. */ + /** + * 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() { @@ -37,7 +44,7 @@ public VirtualMachineInstanceUpdateProperties properties() { /** * Set the properties property: Defines the resource properties for the update. - * + * * @param properties the properties value to set. * @return the VirtualMachineInstanceUpdateRequest object itself. */ @@ -48,7 +55,7 @@ public VirtualMachineInstanceUpdateRequest withProperties(VirtualMachineInstance /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -57,7 +64,7 @@ public Identity identity() { /** * Set the identity property: Identity for the resource. - * + * * @param identity the identity value to set. * @return the VirtualMachineInstanceUpdateRequest object itself. */ @@ -68,7 +75,7 @@ public VirtualMachineInstanceUpdateRequest withIdentity(Identity identity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +86,45 @@ public void validate() { 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 index 666617fa3504..57f411843dce 100644 --- 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 @@ -5,24 +5,31 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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. */ +/** + * The instance view of a virtual machine. + */ @Fluent -public final class VirtualMachineInstanceView { +public final class VirtualMachineInstanceView implements JsonSerializable { /* * The VM Config Agent running on the virtual machine. */ - @JsonProperty(value = "vmAgent") private VirtualMachineConfigAgentInstanceView vmAgent; - /** Creates an instance of VirtualMachineInstanceView class. */ + /** + * 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() { @@ -31,7 +38,7 @@ public VirtualMachineConfigAgentInstanceView 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. */ @@ -42,7 +49,7 @@ public VirtualMachineInstanceView withVmAgent(VirtualMachineConfigAgentInstanceV /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,41 @@ public void validate() { 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 index c0ace49963d4..b15b09dac4dc 100644 --- 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 @@ -9,13 +9,15 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner; -/** Resource collection API of VirtualMachineInstances. */ +/** + * 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. + * 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. @@ -26,9 +28,9 @@ 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. + * 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. @@ -39,10 +41,10 @@ public interface VirtualMachineInstances { /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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. @@ -53,24 +55,24 @@ public interface VirtualMachineInstances { /** * The operation to create or update a virtual machine instance. Please note some properties can be set only during * virtual machine instance creation. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource definition. + * 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); + 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. + * 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. @@ -79,9 +81,9 @@ VirtualMachineInstance createOrUpdate( /** * 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. + * 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. @@ -91,10 +93,10 @@ VirtualMachineInstance createOrUpdate( /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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. @@ -104,24 +106,24 @@ VirtualMachineInstance createOrUpdate( /** * The operation to update a virtual machine instance. - * + * * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource - * to be extended. - * @param virtualMachineInstance The virtual machine instance resource patch definition. + * 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); + 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. + * 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. @@ -131,9 +133,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -144,9 +146,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -156,9 +158,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -169,9 +171,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -181,9 +183,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -194,9 +196,9 @@ VirtualMachineInstance update( /** * 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. + * 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. @@ -206,9 +208,9 @@ VirtualMachineInstance update( /** * 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. + * 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. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java new file mode 100644 index 000000000000..9390ce01f6d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualSwitchConfigurationOverrides.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights 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 VirtualSwitchConfigurationOverrides of a cluster. + */ +@Fluent +public final class VirtualSwitchConfigurationOverrides + implements JsonSerializable { + /* + * Enable IoV for Virtual Switch + */ + private String enableIov; + + /* + * Load Balancing Algorithm for Virtual Switch + */ + private String loadBalancingAlgorithm; + + /** + * Creates an instance of VirtualSwitchConfigurationOverrides class. + */ + public VirtualSwitchConfigurationOverrides() { + } + + /** + * Get the enableIov property: Enable IoV for Virtual Switch. + * + * @return the enableIov value. + */ + public String enableIov() { + return this.enableIov; + } + + /** + * Set the enableIov property: Enable IoV for Virtual Switch. + * + * @param enableIov the enableIov value to set. + * @return the VirtualSwitchConfigurationOverrides object itself. + */ + public VirtualSwitchConfigurationOverrides withEnableIov(String enableIov) { + this.enableIov = enableIov; + return this; + } + + /** + * Get the loadBalancingAlgorithm property: Load Balancing Algorithm for Virtual Switch. + * + * @return the loadBalancingAlgorithm value. + */ + public String loadBalancingAlgorithm() { + return this.loadBalancingAlgorithm; + } + + /** + * Set the loadBalancingAlgorithm property: Load Balancing Algorithm for Virtual Switch. + * + * @param loadBalancingAlgorithm the loadBalancingAlgorithm value to set. + * @return the VirtualSwitchConfigurationOverrides object itself. + */ + public VirtualSwitchConfigurationOverrides withLoadBalancingAlgorithm(String loadBalancingAlgorithm) { + this.loadBalancingAlgorithm = loadBalancingAlgorithm; + 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("enableIov", this.enableIov); + jsonWriter.writeStringField("loadBalancingAlgorithm", this.loadBalancingAlgorithm); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualSwitchConfigurationOverrides from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @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 VirtualSwitchConfigurationOverrides fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualSwitchConfigurationOverrides deserializedVirtualSwitchConfigurationOverrides + = new VirtualSwitchConfigurationOverrides(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableIov".equals(fieldName)) { + deserializedVirtualSwitchConfigurationOverrides.enableIov = reader.getString(); + } else if ("loadBalancingAlgorithm".equals(fieldName)) { + deserializedVirtualSwitchConfigurationOverrides.loadBalancingAlgorithm = reader.getString(); + } else { + reader.skipChildren(); + } + } + + 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 index c5b18f143119..81805b9fed54 100644 --- 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 @@ -5,83 +5,130 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VmSizeEnum. */ +/** + * Defines values for VmSizeEnum. + */ public final class VmSizeEnum extends ExpandableStringEnum { - /** Static value Default for VmSizeEnum. */ + /** + * Static value Default for VmSizeEnum. + */ public static final VmSizeEnum DEFAULT = fromString("Default"); - /** Static value Standard_A2_v2 for VmSizeEnum. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * Static value Standard_K8S4_v1 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_K8S4_V1 = fromString("Standard_K8S4_v1"); - /** Static value Standard_NK6 for VmSizeEnum. */ + /** + * Static value Standard_NK6 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_NK6 = fromString("Standard_NK6"); - /** Static value Standard_NK12 for VmSizeEnum. */ + /** + * Static value Standard_NK12 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_NK12 = fromString("Standard_NK12"); - /** Static value Standard_NV6 for VmSizeEnum. */ + /** + * Static value Standard_NV6 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_NV6 = fromString("Standard_NV6"); - /** Static value Standard_NV12 for VmSizeEnum. */ + /** + * Static value Standard_NV12 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_NV12 = fromString("Standard_NV12"); - /** Static value Standard_K8S5_v1 for VmSizeEnum. */ + /** + * Static value Standard_K8S5_v1 for VmSizeEnum. + */ public static final VmSizeEnum STANDARD_K8S5_V1 = fromString("Standard_K8S5_v1"); - /** Static value Custom for VmSizeEnum. */ + /** + * 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 @@ -90,18 +137,17 @@ public VmSizeEnum() { /** * Creates or finds a VmSizeEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding VmSizeEnum. */ - @JsonCreator public static VmSizeEnum fromString(String name) { return fromString(name, VmSizeEnum.class); } /** * Gets known VmSizeEnum values. - * + * * @return known VmSizeEnum values. */ public static Collection values() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java new file mode 100644 index 000000000000..02026252647c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.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; + +/** + * Desired state of Windows Server Subscription. + */ +public final class WindowsServerSubscription extends ExpandableStringEnum { + /** + * Static value Disabled for WindowsServerSubscription. + */ + public static final WindowsServerSubscription DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for WindowsServerSubscription. + */ + public static final WindowsServerSubscription ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of WindowsServerSubscription value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsServerSubscription() { + } + + /** + * Creates or finds a WindowsServerSubscription from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsServerSubscription. + */ + public static WindowsServerSubscription fromString(String name) { + return fromString(name, WindowsServerSubscription.class); + } + + /** + * Gets known WindowsServerSubscription values. + * + * @return known WindowsServerSubscription values. + */ + public static Collection values() { + return values(WindowsServerSubscription.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/package-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/package-info.java index 82445134a9b5..22d0ea7950cf 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/package-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for AzureStackHciClient. Azure Stack HCI management service. */ +/** + * Package containing the data models for AzureStackHciClient. + * Azure Stack HCI management service. + */ package com.azure.resourcemanager.azurestackhci.models; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/package-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/package-info.java index af64fac35b88..505b7ec7c29a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/package-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for AzureStackHciClient. Azure Stack HCI management service. */ +/** + * Package containing the classes for AzureStackHciClient. + * Azure Stack HCI management service. + */ package com.azure.resourcemanager.azurestackhci; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/module-info.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/module-info.java index 3f4ea8ed319d..cbcafe6ba230 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/module-info.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.azurestackhci { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.azurestackhci; exports com.azure.resourcemanager.azurestackhci.fluent; exports com.azure.resourcemanager.azurestackhci.fluent.models; exports com.azure.resourcemanager.azurestackhci.models; - - opens com.azure.resourcemanager.azurestackhci.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.azurestackhci.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.azurestackhci.fluent.models to com.azure.core; + opens com.azure.resourcemanager.azurestackhci.models to com.azure.core; +} \ No newline at end of file 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 92327034b738..b6577bc84c62 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.GalleryImagesOperationsClientImpl$GalleryImagesOperationsService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.OperationsClientImpl$OperationsService" ], [ "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.StorageContainersOperationsClientImpl$StorageContainersOperationsService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.VirtualHardDisksOperationsClientImpl$VirtualHardDisksOperationsService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.VirtualMachineInstancesClientImpl$VirtualMachineInstancesService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.HybridIdentityMetadatasClientImpl$HybridIdentityMetadatasService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsClientImpl$GuestAgentsService" ], [ "com.azure.resourcemanager.azurestackhci.implementation.GuestAgentsOperationsClientImpl$GuestAgentsOperationsService" ] ] \ 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/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/reflect-config.json b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/reflect-config.json index ae410819794d..8878e547a798 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/reflect-config.json +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurestackhci/reflect-config.json @@ -1,616 +1 @@ -[ { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImagesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImageProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageIdentifier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageVersion", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.GalleryImageVersionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryOSDiskImage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryDiskImage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImageStatusDownloadStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ExtendedLocation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GalleryImagesListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.LogicalNetworksInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.LogicalNetworkProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.Subnet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.SubnetPropertiesFormat", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.RouteTable", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.RouteTablePropertiesFormat", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.Route", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.RoutePropertiesFormat", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpPool", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpPoolInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.LogicalNetworkStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.LogicalNetworkStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.LogicalNetworksUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.LogicalNetworksListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImagesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.MarketplaceGalleryImageProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImageStatusDownloadStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.MarketplaceGalleryImagesListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfacesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.NetworkInterfaceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkInterfaceStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkInterfaceStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkInterfacesListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainersInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.StorageContainerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageContainerStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageContainerStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageContainersListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDisksInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.VirtualHardDiskProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualHardDisksListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.VirtualMachineInstanceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileLinuxConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.SshConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.SshPublicKey", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileDataDisksItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.HttpProxyConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceView", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineConfigAgentInstanceView", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.InstanceViewStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatusProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GuestAgentInstallStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.Identity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.HardwareProfileUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdateDataDisksItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateLinuxConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateWindowsConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.HybridIdentityMetadataProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.HybridIdentityMetadataList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.fluent.models.GuestAgentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GuestCredential", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.GuestAgentList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.CloudInitDataSource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.HyperVGeneration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ProvisioningStateEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.Status", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpAllocationMethodEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.DiskFileFormat", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.VmSizeEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.SecurityTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StatusLevelTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.PowerStateEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.StatusTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ProvisioningAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.IpPoolTypeEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.azurestackhci.models.ResourceIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[ ] \ 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 new file mode 100644 index 000000000000..e04744604322 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.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 ArcSettings ConsentAndInstallDefaultExtensions. + */ +public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + 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 new file mode 100644 index 000000000000..e9735c3d52e6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.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 ArcSettings CreateIdentity. + */ +public final class ArcSettingsCreateIdentitySamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateArcIdentity + * .json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", 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 new file mode 100644 index 000000000000..e96fadbca852 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.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 ArcSettings Create. + */ +public final class ArcSettingsCreateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutArcSetting. + * json + */ + /** + * Sample code: Create ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java new file mode 100644 index 000000000000..c45859d3208f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.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 ArcSettings Delete. + */ +public final class ArcSettingsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteArcSetting. + * json + */ + /** + * Sample code: Delete ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().delete("test-rg", "myCluster", "default", 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 new file mode 100644 index 000000000000..dd667e6ea2a6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.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 ArcSettings GeneratePassword. + */ +public final class ArcSettingsGeneratePasswordSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GeneratePassword. + * json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings() + .generatePasswordWithResponse("test-rg", "myCluster", "default", 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 new file mode 100644 index 000000000000..bda1e34e670a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.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 ArcSettings Get. + */ +public final class ArcSettingsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetArcSetting. + * json + */ + /** + * Sample code: Get ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", 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 new file mode 100644 index 000000000000..4d05de757b76 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.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 ArcSettings InitializeDisableProcess. + */ +public final class ArcSettingsInitializeDisableProcessSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * InitializeDisableProcess.json + */ + /** + * Sample code: Trigger ARC Disable. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..f7b935bdc802 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.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 ArcSettings ListByCluster. + */ +public final class ArcSettingsListByClusterSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + 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 new file mode 100644 index 000000000000..8c5339abf166 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.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.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import java.io.IOException; + +/** + * Samples for ArcSettings Update. + */ +public final class ArcSettingsUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchArcSetting. + * json + */ + /** + * Sample code: Patch ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + ArcSetting resource = manager.arcSettings() + .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withConnectivityProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"enabled\":true,\"serviceConfigurations\":[{\"port\":6516,\"serviceName\":\"WAC\"}]}", + Object.class, SerializerEncoding.JSON)) + .apply(); + } +} 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 new file mode 100644 index 000000000000..e9feb54f842c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.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 Clusters CreateIdentity. + */ +public final class ClustersCreateIdentitySamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * CreateClusterIdentity.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..ac7cdc789a93 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.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.ManagedServiceIdentityType; + +/** + * Samples for Clusters Create. + */ +public final class ClustersCreateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateCluster. + * json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .define("myCluster") + .withRegion("East US") + .withExistingResourceGroup("test-rg") + .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") + .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java new file mode 100644 index 000000000000..0dce7e3390cc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.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 Clusters Delete. + */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteCluster. + * json + */ + /** + * Sample code: Delete cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().delete("test-rg", "myCluster", 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 new file mode 100644 index 000000000000..619cfdd5f2ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; + +/** + * Samples for Clusters ExtendSoftwareAssuranceBenefit. + */ +public final class ClustersExtendSoftwareAssuranceBenefitSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ExtendSoftwareAssuranceBenefit.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .extendSoftwareAssuranceBenefit("test-rg", "myCluster", + new SoftwareAssuranceChangeRequest().withProperties(new SoftwareAssuranceChangeRequestProperties() + .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..fbb5eef1e768 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for Clusters GetByResourceGroup. + */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetCluster.json + */ + /** + * Sample code: Get cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", 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 new file mode 100644 index 000000000000..a42860915a8f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.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 Clusters ListByResourceGroup. + */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + 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 new file mode 100644 index 000000000000..d9d82c8036bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.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 Clusters List. + */ +public final class ClustersListSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + 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/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java new file mode 100644 index 000000000000..29922717453c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +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.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Clusters Update. + */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateCluster. + * json + */ + /** + * Sample code: Update cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withDesiredProperties( + new ClusterDesiredProperties().withWindowsServerSubscription(WindowsServerSubscription.ENABLED) + .withDiagnosticLevel(DiagnosticLevel.BASIC)) + .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/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java new file mode 100644 index 000000000000..b41a485b0d04 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; + +/** + * Samples for Clusters UploadCertificate. + */ +public final class ClustersUploadCertificateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UploadCertificate + * .json + */ + /** + * Sample code: Upload certificate. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters() + .uploadCertificate("test-rg", "myCluster", + new UploadCertificateRequest().withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..1e5c7be20f4e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsCreateOrUpdateSamples.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.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.Observability; +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.ScaleUnits; +import com.azure.resourcemanager.azurestackhci.models.Storage; +import com.azure.resourcemanager.azurestackhci.models.StorageNetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualSwitchConfigurationOverrides; +import java.util.Arrays; + +/** + * Samples for DeploymentSettings CreateOrUpdate. + */ +public final class DeploymentSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * PutDeploymentSettings.json + */ + /** + * Sample code: Create Deployment Settings. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createDeploymentSettings(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.deploymentSettings() + .define("default") + .withExistingCluster("test-rg", "myCluster") + .withArcNodeResourceIds(Arrays.asList( + "/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) + .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 new file mode 100644 index 000000000000..beec0f7e2ad3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsDeleteSamples.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 DeploymentSettings Delete. + */ +public final class DeploymentSettingsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * DeleteDeploymentSettings.json + */ + /** + * Sample code: Delete Deployment Settings. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..b952c02dab6d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsGetSamples.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 DeploymentSettings Get. + */ +public final class DeploymentSettingsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * GetDeploymentSettings.json + */ + /** + * Sample code: Get Deployment Settings. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..f31a5b4e71a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/DeploymentSettingsListByClustersSamples.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 DeploymentSettings ListByClusters. + */ +public final class DeploymentSettingsListByClustersSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ListDeploymentSettingsByCluster.json + */ + /** + * Sample code: List Deployment Settings. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..6b10b4a32404 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NicDetail; +import java.util.Arrays; + +/** + * Samples for EdgeDevices CreateOrUpdate. + */ +public final class EdgeDevicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutEdgeDevices. + * json + */ + /** + * Sample code: Create Edge Device. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createEdgeDevice(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.edgeDevices() + .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 new file mode 100644 index 000000000000..351ff980f2ed --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesDeleteSamples.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 EdgeDevices Delete. + */ +public final class EdgeDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteEdgeDevices + * .json + */ + /** + * Sample code: Delete Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..edd3df2d913f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesGetSamples.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 EdgeDevices Get. + */ +public final class EdgeDevicesGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetEdgeDevices. + * json + */ + /** + * Sample code: Get Edge Device. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a3b008d9826c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesListSamples.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 EdgeDevices List. + */ +public final class EdgeDevicesListSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListEdgeDevices. + * json + */ + /** + * Sample code: List Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..3140c3f4b532 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/EdgeDevicesValidateSamples.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.ValidateRequest; +import java.util.Arrays; + +/** + * Samples for EdgeDevices Validate. + */ +public final class EdgeDevicesValidateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ + * ValidateEdgeDevices.json + */ + /** + * Sample code: Validate Edge Devices. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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", + "default", + new ValidateRequest().withEdgeDeviceIds(Arrays.asList( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/edgeDevices/default", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/edgeDevices/default")) + .withAdditionalInfo("test"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java new file mode 100644 index 000000000000..2ea0a955fe63 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.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.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for Extensions Create. + */ +public final class ExtensionsCreateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutExtension.json + */ + /** + * Sample code: Create Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + manager.extensions() + .define("MicrosoftMonitoringAgent") + .withExistingArcSetting("test-rg", "myCluster", "default") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withEnableAutomaticUpgrade(false) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java new file mode 100644 index 000000000000..c2f880a9d655 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.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 Extensions Delete. + */ +public final class ExtensionsDeleteSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteExtension. + * json + */ + /** + * Sample code: Delete Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + 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 new file mode 100644 index 000000000000..b4592a7bcc09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.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 Extensions Get. + */ +public final class ExtensionsGetSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetExtension.json + */ + /** + * Sample code: Get ArcSettings Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", + 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 new file mode 100644 index 000000000000..066b9050ec3b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.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 Extensions ListByArcSetting. + */ +public final class ExtensionsListByArcSettingSamples { + /* + * x-ms-original-file: + * 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. + */ + public static void + 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 new file mode 100644 index 000000000000..0c5ec4e5172c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; +import java.io.IOException; + +/** + * Samples for Extensions Update. + */ +public final class ExtensionsUpdateSamples { + /* + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchExtension. + * json + */ + /** + * Sample code: Update Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + Extension resource = manager.extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withExtensionParameters(new ExtensionPatchParameters().withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(false) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON))) + .apply(); + } +} 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 new file mode 100644 index 000000000000..45ff28a2f82f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.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; + +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; + +/** + * Samples for Extensions Upgrade. + */ +public final class ExtensionsUpgradeSamples { + /* + * x-ms-original-file: + * 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. + */ + 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 index a78918a238e0..9d786fd04514 100644 --- 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 @@ -8,27 +8,28 @@ import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; -/** Samples for GalleryImagesOperation CreateOrUpdate. */ +/** + * Samples for GalleryImagesOperation CreateOrUpdate. + */ public final class GalleryImagesOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutGalleryImage.json + * 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() + 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)) + .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") 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 index d44594bc740f..6372f4805606 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GalleryImagesOperation Delete. */ +/** + * Samples for GalleryImagesOperation Delete. + */ public final class GalleryImagesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGalleryImage.json + * 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) { 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 index 366dc18135a3..33e44c0d8062 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GalleryImagesOperation GetByResourceGroup. */ +/** + * Samples for GalleryImagesOperation GetByResourceGroup. + */ public final class GalleryImagesOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGalleryImage.json + * 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() + 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 index fa2a719393cb..8d884e220434 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GalleryImagesOperation ListByResourceGroup. */ +/** + * Samples for GalleryImagesOperation ListByResourceGroup. + */ public final class GalleryImagesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageByResourceGroup.json + * 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) { + 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 index 2926a5cd0b4a..6c808e2dfc81 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GalleryImagesOperation List. */ +/** + * Samples for GalleryImagesOperation List. + */ public final class GalleryImagesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageBySubscription.json + * 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) { + 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 index 4aa900b2cea5..090769152be4 100644 --- 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 @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for GalleryImagesOperation Update. */ +/** + * Samples for GalleryImagesOperation Update. + */ public final class GalleryImagesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateGalleryImage.json + * 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(); + GalleryImages resource = manager.galleryImagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } 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 index 6e606e5684d0..532b425da468 100644 --- 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 @@ -8,19 +8,22 @@ import com.azure.resourcemanager.azurestackhci.models.GuestCredential; import com.azure.resourcemanager.azurestackhci.models.ProvisioningAction; -/** Samples for GuestAgent Create. */ +/** + * Samples for GuestAgent Create. + */ public final class GuestAgentCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/CreateGuestAgent.json + * 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() + manager.guestAgents() .create( "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", new GuestAgentInner() 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 index 7404682e03f8..0fe2e111bf56 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GuestAgent Delete. */ +/** + * Samples for GuestAgent Delete. + */ public final class GuestAgentDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGuestAgent.json + * 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() + 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 index 15a37a412056..3f4c3bf8c468 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GuestAgent Get. */ +/** + * Samples for GuestAgent Get. + */ public final class GuestAgentGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGuestAgent.json + * 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() + 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 index 11e83158bf91..a765674f810f 100644 --- 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for GuestAgentsOperation List. */ +/** + * Samples for GuestAgentsOperation List. + */ public final class GuestAgentsOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GuestAgent_List.json + * 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() + 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 index 98cfffc318b5..182a3614d4bc 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for HybridIdentityMetadata Get. */ +/** + * Samples for HybridIdentityMetadata Get. + */ public final class HybridIdentityMetadataGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetHybridIdentityMetadata.json + * 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() + 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 index 99557adc387f..0d81513348a5 100644 --- 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for HybridIdentityMetadata List. */ +/** + * Samples for HybridIdentityMetadata List. + */ public final class HybridIdentityMetadataListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/HybridIdentityMetadata_List.json + * 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() + 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 index b515af5265a0..80be11d8cd08 100644 --- 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 @@ -7,27 +7,28 @@ import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for LogicalNetworksOperation CreateOrUpdate. */ +/** + * Samples for LogicalNetworksOperation CreateOrUpdate. + */ public final class LogicalNetworksOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutLogicalNetwork.json + * 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() + 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)) + .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 index ccd8c0fa9f35..1ad51df3cb3e 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for LogicalNetworksOperation Delete. */ +/** + * Samples for LogicalNetworksOperation Delete. + */ public final class LogicalNetworksOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteLogicalNetwork.json + * 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) { 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 index df5b31db9b47..2da47c74132d 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for LogicalNetworksOperation GetByResourceGroup. */ +/** + * Samples for LogicalNetworksOperation GetByResourceGroup. + */ public final class LogicalNetworksOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetLogicalNetwork.json + * 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() + 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 index 510d6e510b11..07fb410b7a2b 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for LogicalNetworksOperation ListByResourceGroup. */ +/** + * Samples for LogicalNetworksOperation ListByResourceGroup. + */ public final class LogicalNetworksOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkByResourceGroup.json + * 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) { + 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 index f2c06ac5793b..90b3a85bb219 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for LogicalNetworksOperation List. */ +/** + * Samples for LogicalNetworksOperation List. + */ public final class LogicalNetworksOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkBySubscription.json + * 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) { + 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 index 6024130a6cae..89e1c0595ffd 100644 --- 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 @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for LogicalNetworksOperation Update. */ +/** + * Samples for LogicalNetworksOperation Update. + */ public final class LogicalNetworksOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateLogicalNetwork.json + * 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(); + LogicalNetworks resource = manager.logicalNetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-lnet", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } 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 index 41c44fa876cf..087254905ffe 100644 --- 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 @@ -12,38 +12,37 @@ import com.azure.resourcemanager.azurestackhci.models.HyperVGeneration; import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; -/** Samples for MarketplaceGalleryImagesOperation CreateOrUpdate. */ +/** + * Samples for MarketplaceGalleryImagesOperation CreateOrUpdate. + */ public final class MarketplaceGalleryImagesOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutMarketplaceGalleryImage.json + * 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() + 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)) + .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")) + .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 index 30e1363ade52..3eea364d8de1 100644 --- 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for MarketplaceGalleryImagesOperation Delete. */ +/** + * Samples for MarketplaceGalleryImagesOperation Delete. + */ public final class MarketplaceGalleryImagesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteMarketplaceGalleryImage.json + * 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() + 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 index 79b2a4b9bb4f..b9e9c318cadb 100644 --- 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 @@ -4,21 +4,24 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. */ +/** + * Samples for MarketplaceGalleryImagesOperation GetByResourceGroup. + */ public final class MarketplaceGalleryImagesOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetMarketplaceGalleryImage.json + * 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); + 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 index c255160e8b83..56fb0fe4ae0f 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. */ +/** + * Samples for MarketplaceGalleryImagesOperation ListByResourceGroup. + */ public final class MarketplaceGalleryImagesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageByResourceGroup.json + * 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( 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 index f4c35317fbf6..a2e656a72392 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for MarketplaceGalleryImagesOperation List. */ +/** + * Samples for MarketplaceGalleryImagesOperation List. + */ public final class MarketplaceGalleryImagesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageBySubscription.json + * 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( 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 index 12afa609f8d2..70bd5adf1457 100644 --- 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 @@ -8,24 +8,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for MarketplaceGalleryImagesOperation Update. */ +/** + * Samples for MarketplaceGalleryImagesOperation Update. + */ public final class MarketplaceGalleryImagesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateMarketplaceGalleryImage.json + * 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(); + 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(); } 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 index da1b75bb5dae..63160d37ea50 100644 --- 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 @@ -11,35 +11,31 @@ import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; import java.util.Arrays; -/** Samples for NetworkInterfacesOperation CreateOrUpdate. */ +/** + * Samples for NetworkInterfacesOperation CreateOrUpdate. + */ public final class NetworkInterfacesOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutNetworkInterface.json + * 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() + 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"))))) + .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 index a2df68815cf1..9f642a66687a 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for NetworkInterfacesOperation Delete. */ +/** + * Samples for NetworkInterfacesOperation Delete. + */ public final class NetworkInterfacesOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteNetworkInterface.json + * 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) { 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 index 1094f90f0c14..3ff146dde80b 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for NetworkInterfacesOperation GetByResourceGroup. */ +/** + * Samples for NetworkInterfacesOperation GetByResourceGroup. + */ public final class NetworkInterfacesOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetNetworkInterface.json + * 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() + 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 index ca2a3d5d38a0..163f0aad92b4 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for NetworkInterfacesOperation ListByResourceGroup. */ +/** + * Samples for NetworkInterfacesOperation ListByResourceGroup. + */ public final class NetworkInterfacesOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListNetworkInterfaceByResourceGroup.json + * 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) { + 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 index 5ad525241a7d..375d27185296 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for NetworkInterfacesOperation List. */ +/** + * Samples for NetworkInterfacesOperation List. + */ public final class NetworkInterfacesOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListNetworkInterfaceBySubscription.json + * 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) { + 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 index a9f296333dec..4cb1b7e03f99 100644 --- 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 @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for NetworkInterfacesOperation Update. */ +/** + * Samples for NetworkInterfacesOperation Update. + */ public final class NetworkInterfacesOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateNetworkInterface.json + * 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(); + NetworkInterfaces resource = manager.networkInterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } 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 new file mode 100644 index 000000000000..98dd880470c6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..169a3e67fb66 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..f24b8cfec5ae --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.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 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); + } +} 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 9adce40696d0..8fabfea7e22e 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 @@ -4,17 +4,21 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListOperations.json + * x-ms-original-file: + * specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListOperations. + * json */ /** - * Sample code: ListOperations. - * + * Sample code: Create cluster. + * * @param manager Entry point to AzureStackHciManager. */ - public static void listOperations(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + 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 new file mode 100644 index 000000000000..99b97df65972 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for 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); + } +} 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 new file mode 100644 index 000000000000..fafe3ca75088 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..9ae79c6c14bc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.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(); + } +} 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 new file mode 100644 index 000000000000..83ad8617f918 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsDeleteSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..0d5654c568c3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..1a9eb3057954 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SecuritySettingsListByClustersSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..724e1839ded7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..3b69a72b8ddb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.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 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); + } +} 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 index c55f0611474f..cb75a6956263 100644 --- 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 @@ -7,27 +7,28 @@ import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for StorageContainersOperation CreateOrUpdate. */ +/** + * Samples for StorageContainersOperation CreateOrUpdate. + */ public final class StorageContainersOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutStorageContainer.json + * 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() + 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)) + .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 index 6b9385553f57..804348f6976d 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for StorageContainersOperation Delete. */ +/** + * Samples for StorageContainersOperation Delete. + */ public final class StorageContainersOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteStorageContainer.json + * 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) { 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 index b716302aa629..fb9d41844433 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for StorageContainersOperation GetByResourceGroup. */ +/** + * Samples for StorageContainersOperation GetByResourceGroup. + */ public final class StorageContainersOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetStorageContainer.json + * 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() + 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 index f12f912236cd..36475c950d49 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for StorageContainersOperation ListByResourceGroup. */ +/** + * Samples for StorageContainersOperation ListByResourceGroup. + */ public final class StorageContainersOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerByResourceGroup.json + * 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) { + 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 index 85eee37012bf..732e670f0910 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for StorageContainersOperation List. */ +/** + * Samples for StorageContainersOperation List. + */ public final class StorageContainersOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerBySubscription.json + * 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) { + 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 index beec0fad0010..a8a18fc31663 100644 --- 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 @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for StorageContainersOperation Update. */ +/** + * Samples for StorageContainersOperation Update. + */ public final class StorageContainersOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateStorageContainer.json + * 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(); + StorageContainers resource = manager.storageContainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } 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 new file mode 100644 index 000000000000..fff0e4ae2e0c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..8a0a53e3c5a9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..3fa70091a68d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..7635db7b8d60 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +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(); + } +} 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 new file mode 100644 index 000000000000..751937fffe00 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..13758c7389b8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..a65190e8f999 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..1496e9906bbc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.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.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); + } +} 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 new file mode 100644 index 000000000000..0fad93789421 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.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 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. + */ + 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 new file mode 100644 index 000000000000..c193595d528e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.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 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); + } +} 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 new file mode 100644 index 000000000000..b607b31b1257 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for 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); + } +} 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 new file mode 100644 index 000000000000..44f98802e63e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** + * Samples for 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); + } +} 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 new file mode 100644 index 000000000000..3bdce04c5465 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.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.generated; + +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 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(); + } +} 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 index 422eacdc1bfb..6a09e7f8668f 100644 --- 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 @@ -7,27 +7,28 @@ import com.azure.resourcemanager.azurestackhci.models.ExtendedLocation; import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -/** Samples for VirtualHardDisksOperation CreateOrUpdate. */ +/** + * Samples for VirtualHardDisksOperation CreateOrUpdate. + */ public final class VirtualHardDisksOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualHardDisk.json + * 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() + 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)) + .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 index 843f38d669a4..e0094f56cf4c 100644 --- 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualHardDisksOperation Delete. */ +/** + * Samples for VirtualHardDisksOperation Delete. + */ public final class VirtualHardDisksOperationDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualHardDisk.json + * 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) { 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 index 90b8e153a117..366fe9727238 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualHardDisksOperation GetByResourceGroup. */ +/** + * Samples for VirtualHardDisksOperation GetByResourceGroup. + */ public final class VirtualHardDisksOperationGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualHardDisk.json + * 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() + 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 index 04418c336c8b..6209f82c3c0e 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualHardDisksOperation ListByResourceGroup. */ +/** + * Samples for VirtualHardDisksOperation ListByResourceGroup. + */ public final class VirtualHardDisksOperationListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + * 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) { + 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 index 2d4d5e86b557..278bd4b4a05c 100644 --- 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualHardDisksOperation List. */ +/** + * Samples for VirtualHardDisksOperation List. + */ public final class VirtualHardDisksOperationListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskBySubscription.json + * 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) { + 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 index 36b91f74e708..6e8d647b825c 100644 --- 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 @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for VirtualHardDisksOperation Update. */ +/** + * Samples for VirtualHardDisksOperation Update. + */ public final class VirtualHardDisksOperationUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualHardDisk.json + * 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(); + VirtualHardDisks resource = manager.virtualHardDisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("additionalProperties", "sample")).apply(); } 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 index bc04b435ee54..ed76f16d08a1 100644 --- 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 @@ -20,207 +20,157 @@ import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; import java.util.Arrays; -/** Samples for VirtualMachineInstances CreateOrUpdate. */ +/** + * Samples for VirtualMachineInstances CreateOrUpdate. + */ public final class VirtualMachineInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithGalleryImage.json + * 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() + 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)) + 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")))) + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) .withOsProfile( - new VirtualMachineInstancePropertiesOsProfile() - .withAdminPassword("fakeTokenPlaceholder") + 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")), + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference(new VirtualMachineInstancePropertiesStorageProfileImageReference().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithOsDisk.json + * 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() + 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)) + 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")), + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withOsDisk(new VirtualMachineInstancePropertiesStorageProfileOsDisk().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json + * 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() + 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)) + 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")))) + .withNetworkProfile(new VirtualMachineInstancePropertiesNetworkProfile().withNetworkInterfaces( + Arrays.asList(new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() + .withId("test-nic")))) .withOsProfile( - new VirtualMachineInstancePropertiesOsProfile() - .withAdminPassword("fakeTokenPlaceholder") + 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")), + .withSecurityProfile(new VirtualMachineInstancePropertiesSecurityProfile().withEnableTpm(true) + .withUefiSettings(new VirtualMachineInstancePropertiesSecurityProfileUefiSettings() + .withSecureBootEnabled(true))) + .withStorageProfile(new VirtualMachineInstancePropertiesStorageProfile() + .withImageReference(new VirtualMachineInstancePropertiesStorageProfileImageReference().withId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image")) + .withVmConfigStoragePathId( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithVMConfigAgent.json + * 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() + 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)) + 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")), + .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 index 6d47215d33bc..9747ba3ed257 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances Delete. */ +/** + * Samples for VirtualMachineInstances Delete. + */ public final class VirtualMachineInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualMachineInstance.json + * 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() + 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 index 63d53d6f4e16..44fe23a5764a 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances Get. */ +/** + * Samples for VirtualMachineInstances Get. + */ public final class VirtualMachineInstancesGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualMachineInstance.json + * 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() + 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 index c93246812a55..c7140d11d06d 100644 --- 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances List. */ +/** + * Samples for VirtualMachineInstances List. + */ public final class VirtualMachineInstancesListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualMachineInstances.json + * 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() + 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 index 42d93a2868e1..80827b53c1fb 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances Restart. */ +/** + * Samples for VirtualMachineInstances Restart. + */ public final class VirtualMachineInstancesRestartSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/RestartVirtualMachineInstance.json + * 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() + 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 index 0ff7ee6dad14..20f61f9112be 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances Start. */ +/** + * Samples for VirtualMachineInstances Start. + */ public final class VirtualMachineInstancesStartSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StartVirtualMachineInstance.json + * 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() + 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 index 6c010e085461..c738e69a01e1 100644 --- 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.azurestackhci.generated; -/** Samples for VirtualMachineInstances Stop. */ +/** + * Samples for VirtualMachineInstances Stop. + */ public final class VirtualMachineInstancesStopSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StopVirtualMachineInstance.json + * 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() + 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 index ce954da5f954..ad8f05badff9 100644 --- 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 @@ -10,32 +10,28 @@ import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceUpdateRequest; import java.util.Arrays; -/** Samples for VirtualMachineInstances Update. */ +/** + * Samples for VirtualMachineInstances Update. + */ public final class VirtualMachineInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualMachineInstance.json + * 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() + 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"))))), + 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/ExtendedLocationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtendedLocationTests.java deleted file mode 100644 index 993201433857..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/ExtendedLocationTests.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.ExtendedLocation; -import com.azure.resourcemanager.azurestackhci.models.ExtendedLocationTypes; -import org.junit.jupiter.api.Assertions; - -public final class ExtendedLocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtendedLocation model = - BinaryData - .fromString("{\"name\":\"xhekuksjtxukcdm\",\"type\":\"CustomLocation\"}") - .toObject(ExtendedLocation.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedLocation model = - new ExtendedLocation().withName("xhekuksjtxukcdm").withType(ExtendedLocationTypes.CUSTOM_LOCATION); - model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryDiskImageTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryDiskImageTests.java deleted file mode 100644 index dd37b911c70c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryDiskImageTests.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.GalleryDiskImage; - -public final class GalleryDiskImageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryDiskImage model = - BinaryData.fromString("{\"sizeInMB\":4167374630645699201}").toObject(GalleryDiskImage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryDiskImage model = new GalleryDiskImage(); - model = BinaryData.fromObject(model).toObject(GalleryDiskImage.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageIdentifierTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageIdentifierTests.java deleted file mode 100644 index 9dee35a10faf..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageIdentifierTests.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.GalleryImageIdentifier; -import org.junit.jupiter.api.Assertions; - -public final class GalleryImageIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageIdentifier model = - BinaryData - .fromString("{\"publisher\":\"xrifkwmrvkts\",\"offer\":\"zntocipaouajps\",\"sku\":\"ucmpoyfd\"}") - .toObject(GalleryImageIdentifier.class); - Assertions.assertEquals("xrifkwmrvkts", model.publisher()); - Assertions.assertEquals("zntocipaouajps", model.offer()); - Assertions.assertEquals("ucmpoyfd", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageIdentifier model = - new GalleryImageIdentifier().withPublisher("xrifkwmrvkts").withOffer("zntocipaouajps").withSku("ucmpoyfd"); - model = BinaryData.fromObject(model).toObject(GalleryImageIdentifier.class); - Assertions.assertEquals("xrifkwmrvkts", model.publisher()); - Assertions.assertEquals("zntocipaouajps", model.offer()); - Assertions.assertEquals("ucmpoyfd", model.sku()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusDownloadStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusDownloadStatusTests.java deleted file mode 100644 index 5bd9577532b4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusDownloadStatusTests.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.GalleryImageStatusDownloadStatus; -import org.junit.jupiter.api.Assertions; - -public final class GalleryImageStatusDownloadStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageStatusDownloadStatus model = - BinaryData - .fromString("{\"downloadSizeInMB\":5604417483302342339}") - .toObject(GalleryImageStatusDownloadStatus.class); - Assertions.assertEquals(5604417483302342339L, model.downloadSizeInMB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageStatusDownloadStatus model = - new GalleryImageStatusDownloadStatus().withDownloadSizeInMB(5604417483302342339L); - model = BinaryData.fromObject(model).toObject(GalleryImageStatusDownloadStatus.class); - Assertions.assertEquals(5604417483302342339L, model.downloadSizeInMB()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusProvisioningStatusTests.java deleted file mode 100644 index f28c6f13723a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageStatusProvisioningStatusTests.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.GalleryImageStatusProvisioningStatus; -import com.azure.resourcemanager.azurestackhci.models.Status; -import org.junit.jupiter.api.Assertions; - -public final class GalleryImageStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"smy\",\"status\":\"Succeeded\"}") - .toObject(GalleryImageStatusProvisioningStatus.class); - Assertions.assertEquals("smy", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageStatusProvisioningStatus model = - new GalleryImageStatusProvisioningStatus().withOperationId("smy").withStatus(Status.SUCCEEDED); - model = BinaryData.fromObject(model).toObject(GalleryImageStatusProvisioningStatus.class); - Assertions.assertEquals("smy", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionPropertiesTests.java deleted file mode 100644 index 6af26902fe74..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionPropertiesTests.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.fluent.models.GalleryImageVersionProperties; -import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.azurestackhci.models.GalleryOSDiskImage; - -public final class GalleryImageVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageVersionProperties model = - BinaryData - .fromString("{\"storageProfile\":{\"osDiskImage\":{\"sizeInMB\":5458295378310588928}}}") - .toObject(GalleryImageVersionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageVersionProperties model = - new GalleryImageVersionProperties() - .withStorageProfile(new GalleryImageVersionStorageProfile().withOsDiskImage(new GalleryOSDiskImage())); - model = BinaryData.fromObject(model).toObject(GalleryImageVersionProperties.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionStorageProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionStorageProfileTests.java deleted file mode 100644 index 126437fb33f4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionStorageProfileTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.azurestackhci.models.GalleryOSDiskImage; - -public final class GalleryImageVersionStorageProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageVersionStorageProfile model = - BinaryData - .fromString("{\"osDiskImage\":{\"sizeInMB\":5597579256870764074}}") - .toObject(GalleryImageVersionStorageProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageVersionStorageProfile model = - new GalleryImageVersionStorageProfile().withOsDiskImage(new GalleryOSDiskImage()); - model = BinaryData.fromObject(model).toObject(GalleryImageVersionStorageProfile.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionTests.java deleted file mode 100644 index 76936045917c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImageVersionTests.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.GalleryImageVersion; -import com.azure.resourcemanager.azurestackhci.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.azurestackhci.models.GalleryOSDiskImage; -import org.junit.jupiter.api.Assertions; - -public final class GalleryImageVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImageVersion model = - BinaryData - .fromString( - "{\"name\":\"ogknygjofjdd\",\"properties\":{\"storageProfile\":{\"osDiskImage\":{\"sizeInMB\":3233201824029317370}}}}") - .toObject(GalleryImageVersion.class); - Assertions.assertEquals("ogknygjofjdd", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageVersion model = - new GalleryImageVersion() - .withName("ogknygjofjdd") - .withStorageProfile(new GalleryImageVersionStorageProfile().withOsDiskImage(new GalleryOSDiskImage())); - model = BinaryData.fromObject(model).toObject(GalleryImageVersion.class); - Assertions.assertEquals("ogknygjofjdd", model.name()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesUpdateRequestTests.java deleted file mode 100644 index 3a04ca143589..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryImagesUpdateRequestTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.GalleryImagesUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class GalleryImagesUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryImagesUpdateRequest model = - BinaryData - .fromString( - "{\"tags\":{\"anzwuxzdxta\":\"y\",\"hfpmrqobmtukknr\":\"rlhm\",\"gnwzsymglzufc\":\"rtihfxtijbpz\",\"hdbihan\":\"zk\"}}") - .toObject(GalleryImagesUpdateRequest.class); - Assertions.assertEquals("y", model.tags().get("anzwuxzdxta")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImagesUpdateRequest model = - new GalleryImagesUpdateRequest() - .withTags( - mapOf( - "anzwuxzdxta", - "y", - "hfpmrqobmtukknr", - "rlhm", - "gnwzsymglzufc", - "rtihfxtijbpz", - "hdbihan", - "zk")); - model = BinaryData.fromObject(model).toObject(GalleryImagesUpdateRequest.class); - Assertions.assertEquals("y", model.tags().get("anzwuxzdxta")); - } - - // 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/GalleryOSDiskImageTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryOSDiskImageTests.java deleted file mode 100644 index 470de108ecaa..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GalleryOSDiskImageTests.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.GalleryOSDiskImage; - -public final class GalleryOSDiskImageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryOSDiskImage model = - BinaryData.fromString("{\"sizeInMB\":8523359422088474782}").toObject(GalleryOSDiskImage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryOSDiskImage model = new GalleryOSDiskImage(); - model = BinaryData.fromObject(model).toObject(GalleryOSDiskImage.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentInstallStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentInstallStatusTests.java deleted file mode 100644 index e105984d93b9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/GuestAgentInstallStatusTests.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.GuestAgentInstallStatus; - -public final class GuestAgentInstallStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GuestAgentInstallStatus model = - BinaryData - .fromString( - "{\"vmUuid\":\"fbkp\",\"status\":\"Succeeded\",\"lastStatusChange\":\"2021-02-08T07:21:06Z\",\"agentVersion\":\"ndnhj\",\"errorDetails\":[]}") - .toObject(GuestAgentInstallStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GuestAgentInstallStatus model = new GuestAgentInstallStatus(); - model = BinaryData.fromObject(model).toObject(GuestAgentInstallStatus.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HardwareProfileUpdateTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HardwareProfileUpdateTests.java deleted file mode 100644 index 1492f0ba86b1..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HardwareProfileUpdateTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.HardwareProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; -import org.junit.jupiter.api.Assertions; - -public final class HardwareProfileUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareProfileUpdate model = - BinaryData - .fromString( - "{\"vmSize\":\"Standard_K8S5_v1\",\"processors\":1792717087,\"memoryMB\":3914209859881409326}") - .toObject(HardwareProfileUpdate.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_K8S5_V1, model.vmSize()); - Assertions.assertEquals(1792717087, model.processors()); - Assertions.assertEquals(3914209859881409326L, model.memoryMB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareProfileUpdate model = - new HardwareProfileUpdate() - .withVmSize(VmSizeEnum.STANDARD_K8S5_V1) - .withProcessors(1792717087) - .withMemoryMB(3914209859881409326L); - model = BinaryData.fromObject(model).toObject(HardwareProfileUpdate.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_K8S5_V1, model.vmSize()); - Assertions.assertEquals(1792717087, model.processors()); - Assertions.assertEquals(3914209859881409326L, model.memoryMB()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HttpProxyConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HttpProxyConfigurationTests.java deleted file mode 100644 index bd197a67ca0a..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/HttpProxyConfigurationTests.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.models.HttpProxyConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class HttpProxyConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpProxyConfiguration model = - BinaryData - .fromString( - "{\"httpProxy\":\"sgwbnbbeld\",\"httpsProxy\":\"k\",\"noProxy\":[\"liourqhak\"],\"trustedCa\":\"hashsfwxosow\"}") - .toObject(HttpProxyConfiguration.class); - Assertions.assertEquals("sgwbnbbeld", model.httpProxy()); - Assertions.assertEquals("k", model.httpsProxy()); - Assertions.assertEquals("liourqhak", model.noProxy().get(0)); - Assertions.assertEquals("hashsfwxosow", model.trustedCa()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpProxyConfiguration model = - new HttpProxyConfiguration() - .withHttpProxy("sgwbnbbeld") - .withHttpsProxy("k") - .withNoProxy(Arrays.asList("liourqhak")) - .withTrustedCa("hashsfwxosow"); - model = BinaryData.fromObject(model).toObject(HttpProxyConfiguration.class); - Assertions.assertEquals("sgwbnbbeld", model.httpProxy()); - Assertions.assertEquals("k", model.httpsProxy()); - Assertions.assertEquals("liourqhak", model.noProxy().get(0)); - Assertions.assertEquals("hashsfwxosow", model.trustedCa()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IdentityTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IdentityTests.java deleted file mode 100644 index 2deda47d0c8b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IdentityTests.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.Identity; -import com.azure.resourcemanager.azurestackhci.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString("{\"principalId\":\"hvylwzbt\",\"tenantId\":\"xujznbmpowu\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InterfaceDnsSettingsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InterfaceDnsSettingsTests.java deleted file mode 100644 index e65e860692ba..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/InterfaceDnsSettingsTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InterfaceDnsSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InterfaceDnsSettings model = - BinaryData.fromString("{\"dnsServers\":[\"ypewrmjmwvvjekt\"]}").toObject(InterfaceDnsSettings.class); - Assertions.assertEquals("ypewrmjmwvvjekt", model.dnsServers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InterfaceDnsSettings model = new InterfaceDnsSettings().withDnsServers(Arrays.asList("ypewrmjmwvvjekt")); - model = BinaryData.fromObject(model).toObject(InterfaceDnsSettings.class); - Assertions.assertEquals("ypewrmjmwvvjekt", model.dnsServers().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesSubnetTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesSubnetTests.java deleted file mode 100644 index 90707fa29d83..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesSubnetTests.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.IpConfigurationPropertiesSubnet; -import org.junit.jupiter.api.Assertions; - -public final class IpConfigurationPropertiesSubnetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpConfigurationPropertiesSubnet model = - BinaryData.fromString("{\"id\":\"zf\"}").toObject(IpConfigurationPropertiesSubnet.class); - Assertions.assertEquals("zf", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpConfigurationPropertiesSubnet model = new IpConfigurationPropertiesSubnet().withId("zf"); - model = BinaryData.fromObject(model).toObject(IpConfigurationPropertiesSubnet.class); - Assertions.assertEquals("zf", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesTests.java deleted file mode 100644 index 18abb9a34e5b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationPropertiesTests.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.IpConfigurationProperties; -import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; -import org.junit.jupiter.api.Assertions; - -public final class IpConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpConfigurationProperties model = - BinaryData - .fromString( - "{\"gateway\":\"ohoqqnwvlryav\",\"prefixLength\":\"heun\",\"privateIPAddress\":\"qhgyxzkonocukok\",\"subnet\":{\"id\":\"xuconu\"}}") - .toObject(IpConfigurationProperties.class); - Assertions.assertEquals("qhgyxzkonocukok", model.privateIpAddress()); - Assertions.assertEquals("xuconu", model.subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpConfigurationProperties model = - new IpConfigurationProperties() - .withPrivateIpAddress("qhgyxzkonocukok") - .withSubnet(new IpConfigurationPropertiesSubnet().withId("xuconu")); - model = BinaryData.fromObject(model).toObject(IpConfigurationProperties.class); - Assertions.assertEquals("qhgyxzkonocukok", model.privateIpAddress()); - Assertions.assertEquals("xuconu", model.subnet().id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationTests.java deleted file mode 100644 index 7ac0871a0f96..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpConfigurationTests.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.models.IpConfiguration; -import com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties; -import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; -import org.junit.jupiter.api.Assertions; - -public final class IpConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpConfiguration model = - BinaryData - .fromString( - "{\"name\":\"hagalpbuxwgipwh\",\"properties\":{\"gateway\":\"wkgshwa\",\"prefixLength\":\"ixzbinjeputtmryw\",\"privateIPAddress\":\"zoqftiyqzrnkcqvy\",\"subnet\":{\"id\":\"hzls\"}}}") - .toObject(IpConfiguration.class); - Assertions.assertEquals("hagalpbuxwgipwh", model.name()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.properties().privateIpAddress()); - Assertions.assertEquals("hzls", model.properties().subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpConfiguration model = - new IpConfiguration() - .withName("hagalpbuxwgipwh") - .withProperties( - new IpConfigurationProperties() - .withPrivateIpAddress("zoqftiyqzrnkcqvy") - .withSubnet(new IpConfigurationPropertiesSubnet().withId("hzls"))); - model = BinaryData.fromObject(model).toObject(IpConfiguration.class); - Assertions.assertEquals("hagalpbuxwgipwh", model.name()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.properties().privateIpAddress()); - Assertions.assertEquals("hzls", model.properties().subnet().id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolInfoTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolInfoTests.java deleted file mode 100644 index 404cb9f1b0d4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolInfoTests.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.IpPoolInfo; - -public final class IpPoolInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPoolInfo model = - BinaryData.fromString("{\"used\":\"gwdslfhotwm\",\"available\":\"npwlbjnpg\"}").toObject(IpPoolInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPoolInfo model = new IpPoolInfo(); - model = BinaryData.fromObject(model).toObject(IpPoolInfo.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolTests.java deleted file mode 100644 index 46ddfeb32fc4..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/IpPoolTests.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.IpPool; -import com.azure.resourcemanager.azurestackhci.models.IpPoolInfo; -import com.azure.resourcemanager.azurestackhci.models.IpPoolTypeEnum; -import org.junit.jupiter.api.Assertions; - -public final class IpPoolTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPool model = - BinaryData - .fromString( - "{\"name\":\"seiphe\",\"ipPoolType\":\"vm\",\"start\":\"keyyi\",\"end\":\"jbdlwtgrhpdjpju\",\"info\":{\"used\":\"xazjpqyegual\",\"available\":\"xxhejjzzvd\"}}") - .toObject(IpPool.class); - Assertions.assertEquals("seiphe", model.name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPoolType()); - Assertions.assertEquals("keyyi", model.start()); - Assertions.assertEquals("jbdlwtgrhpdjpju", model.end()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPool model = - new IpPool() - .withName("seiphe") - .withIpPoolType(IpPoolTypeEnum.VM) - .withStart("keyyi") - .withEnd("jbdlwtgrhpdjpju") - .withInfo(new IpPoolInfo()); - model = BinaryData.fromObject(model).toObject(IpPool.class); - Assertions.assertEquals("seiphe", model.name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPoolType()); - Assertions.assertEquals("keyyi", model.start()); - Assertions.assertEquals("jbdlwtgrhpdjpju", model.end()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkPropertiesDhcpOptionsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkPropertiesDhcpOptionsTests.java deleted file mode 100644 index 420b9f2c2ceb..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkPropertiesDhcpOptionsTests.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.LogicalNetworkPropertiesDhcpOptions; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogicalNetworkPropertiesDhcpOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogicalNetworkPropertiesDhcpOptions model = - BinaryData - .fromString("{\"dnsServers\":[\"tnwu\",\"zga\",\"x\",\"fizuckyf\"]}") - .toObject(LogicalNetworkPropertiesDhcpOptions.class); - Assertions.assertEquals("tnwu", model.dnsServers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogicalNetworkPropertiesDhcpOptions model = - new LogicalNetworkPropertiesDhcpOptions().withDnsServers(Arrays.asList("tnwu", "zga", "x", "fizuckyf")); - model = BinaryData.fromObject(model).toObject(LogicalNetworkPropertiesDhcpOptions.class); - Assertions.assertEquals("tnwu", model.dnsServers().get(0)); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkStatusProvisioningStatusTests.java deleted file mode 100644 index 65af88bf5708..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworkStatusProvisioningStatusTests.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.LogicalNetworkStatusProvisioningStatus; -import com.azure.resourcemanager.azurestackhci.models.Status; -import org.junit.jupiter.api.Assertions; - -public final class LogicalNetworkStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogicalNetworkStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"pusuesn\",\"status\":\"Succeeded\"}") - .toObject(LogicalNetworkStatusProvisioningStatus.class); - Assertions.assertEquals("pusuesn", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogicalNetworkStatusProvisioningStatus model = - new LogicalNetworkStatusProvisioningStatus().withOperationId("pusuesn").withStatus(Status.SUCCEEDED); - model = BinaryData.fromObject(model).toObject(LogicalNetworkStatusProvisioningStatus.class); - Assertions.assertEquals("pusuesn", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksUpdateRequestTests.java deleted file mode 100644 index 0e016193ba04..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/LogicalNetworksUpdateRequestTests.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.models.LogicalNetworksUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogicalNetworksUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogicalNetworksUpdateRequest model = - BinaryData - .fromString( - "{\"tags\":{\"xzdmohctb\":\"bavo\",\"ndnvo\":\"vudwx\",\"lazjdyggdtjixhbk\":\"gujjugwdkcglh\"}}") - .toObject(LogicalNetworksUpdateRequest.class); - Assertions.assertEquals("bavo", model.tags().get("xzdmohctb")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogicalNetworksUpdateRequest model = - new LogicalNetworksUpdateRequest() - .withTags(mapOf("xzdmohctb", "bavo", "ndnvo", "vudwx", "lazjdyggdtjixhbk", "gujjugwdkcglh")); - model = BinaryData.fromObject(model).toObject(LogicalNetworksUpdateRequest.class); - Assertions.assertEquals("bavo", model.tags().get("xzdmohctb")); - } - - // 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/MarketplaceGalleryImageStatusDownloadStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImageStatusDownloadStatusTests.java deleted file mode 100644 index fcd58a0c02fd..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImageStatusDownloadStatusTests.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.MarketplaceGalleryImageStatusDownloadStatus; -import org.junit.jupiter.api.Assertions; - -public final class MarketplaceGalleryImageStatusDownloadStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MarketplaceGalleryImageStatusDownloadStatus model = - BinaryData - .fromString("{\"downloadSizeInMB\":4225896230813201107}") - .toObject(MarketplaceGalleryImageStatusDownloadStatus.class); - Assertions.assertEquals(4225896230813201107L, model.downloadSizeInMB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MarketplaceGalleryImageStatusDownloadStatus model = - new MarketplaceGalleryImageStatusDownloadStatus().withDownloadSizeInMB(4225896230813201107L); - model = BinaryData.fromObject(model).toObject(MarketplaceGalleryImageStatusDownloadStatus.class); - Assertions.assertEquals(4225896230813201107L, model.downloadSizeInMB()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImageStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImageStatusProvisioningStatusTests.java deleted file mode 100644 index 12af69a9c43b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImageStatusProvisioningStatusTests.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.MarketplaceGalleryImageStatusProvisioningStatus; -import com.azure.resourcemanager.azurestackhci.models.Status; -import org.junit.jupiter.api.Assertions; - -public final class MarketplaceGalleryImageStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MarketplaceGalleryImageStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"czvyifq\",\"status\":\"InProgress\"}") - .toObject(MarketplaceGalleryImageStatusProvisioningStatus.class); - Assertions.assertEquals("czvyifq", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MarketplaceGalleryImageStatusProvisioningStatus model = - new MarketplaceGalleryImageStatusProvisioningStatus() - .withOperationId("czvyifq") - .withStatus(Status.IN_PROGRESS); - model = BinaryData.fromObject(model).toObject(MarketplaceGalleryImageStatusProvisioningStatus.class); - Assertions.assertEquals("czvyifq", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesUpdateRequestTests.java deleted file mode 100644 index aa663a998317..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/MarketplaceGalleryImagesUpdateRequestTests.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.models.MarketplaceGalleryImagesUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MarketplaceGalleryImagesUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MarketplaceGalleryImagesUpdateRequest model = - BinaryData.fromString("{\"tags\":{\"d\":\"lrmv\"}}").toObject(MarketplaceGalleryImagesUpdateRequest.class); - Assertions.assertEquals("lrmv", model.tags().get("d")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MarketplaceGalleryImagesUpdateRequest model = - new MarketplaceGalleryImagesUpdateRequest().withTags(mapOf("d", "lrmv")); - model = BinaryData.fromObject(model).toObject(MarketplaceGalleryImagesUpdateRequest.class); - Assertions.assertEquals("lrmv", model.tags().get("d")); - } - - // 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/NetworkInterfaceStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfaceStatusProvisioningStatusTests.java deleted file mode 100644 index 4fe6285bf0e8..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfaceStatusProvisioningStatusTests.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.NetworkInterfaceStatusProvisioningStatus; -import com.azure.resourcemanager.azurestackhci.models.Status; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfaceStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfaceStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"rzpwvlqdqgbiq\",\"status\":\"InProgress\"}") - .toObject(NetworkInterfaceStatusProvisioningStatus.class); - Assertions.assertEquals("rzpwvlqdqgbiq", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfaceStatusProvisioningStatus model = - new NetworkInterfaceStatusProvisioningStatus() - .withOperationId("rzpwvlqdqgbiq") - .withStatus(Status.IN_PROGRESS); - model = BinaryData.fromObject(model).toObject(NetworkInterfaceStatusProvisioningStatus.class); - Assertions.assertEquals("rzpwvlqdqgbiq", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesUpdateRequestTests.java deleted file mode 100644 index 8a2df3027902..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkInterfacesUpdateRequestTests.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.NetworkInterfacesUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfacesUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfacesUpdateRequest model = - BinaryData - .fromString("{\"tags\":{\"kymuctqhjfbebr\":\"aetcktvfcivfs\"}}") - .toObject(NetworkInterfacesUpdateRequest.class); - Assertions.assertEquals("aetcktvfcivfs", model.tags().get("kymuctqhjfbebr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfacesUpdateRequest model = - new NetworkInterfacesUpdateRequest().withTags(mapOf("kymuctqhjfbebr", "aetcktvfcivfs")); - model = BinaryData.fromObject(model).toObject(NetworkInterfacesUpdateRequest.class); - Assertions.assertEquals("aetcktvfcivfs", model.tags().get("kymuctqhjfbebr")); - } - - // 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/NetworkProfileUpdateNetworkInterfacesItemTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkProfileUpdateNetworkInterfacesItemTests.java deleted file mode 100644 index 26e6213d6669..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkProfileUpdateNetworkInterfacesItemTests.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.NetworkProfileUpdateNetworkInterfacesItem; -import org.junit.jupiter.api.Assertions; - -public final class NetworkProfileUpdateNetworkInterfacesItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkProfileUpdateNetworkInterfacesItem model = - BinaryData - .fromString("{\"id\":\"wyjsflhhcaalnjix\"}") - .toObject(NetworkProfileUpdateNetworkInterfacesItem.class); - Assertions.assertEquals("wyjsflhhcaalnjix", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkProfileUpdateNetworkInterfacesItem model = - new NetworkProfileUpdateNetworkInterfacesItem().withId("wyjsflhhcaalnjix"); - model = BinaryData.fromObject(model).toObject(NetworkProfileUpdateNetworkInterfacesItem.class); - Assertions.assertEquals("wyjsflhhcaalnjix", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkProfileUpdateTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkProfileUpdateTests.java deleted file mode 100644 index 4c243a388138..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/NetworkProfileUpdateTests.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.NetworkProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkProfileUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkProfileUpdate model = - BinaryData.fromString("{\"networkInterfaces\":[{\"id\":\"smv\"}]}").toObject(NetworkProfileUpdate.class); - Assertions.assertEquals("smv", model.networkInterfaces().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkProfileUpdate model = - new NetworkProfileUpdate() - .withNetworkInterfaces(Arrays.asList(new NetworkProfileUpdateNetworkInterfacesItem().withId("smv"))); - model = BinaryData.fromObject(model).toObject(NetworkProfileUpdate.class); - Assertions.assertEquals("smv", model.networkInterfaces().get(0).id()); - } -} 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 58e21224c59e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationDisplayTests.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.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"zgvfcjrwz\",\"resource\":\"xjtfelluwfzit\",\"operation\":\"peqfpjkjl\",\"description\":\"fpdvhpfxxypi\"}") - .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/OperationInnerTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationInnerTests.java deleted file mode 100644 index 7d81439d130b..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.fluent.models.OperationInner; -import com.azure.resourcemanager.azurestackhci.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"zakljlahbc\",\"isDataAction\":true,\"display\":{\"provider\":\"fdosyg\",\"resource\":\"paojakhmsbzjh\",\"operation\":\"zevdphlx\",\"description\":\"lthqtrgqjbp\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultTests.java deleted file mode 100644 index ddc2c6fc18ac..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"dcc\",\"isDataAction\":false,\"display\":{\"provider\":\"cnyejhkryhtnapcz\",\"resource\":\"okjye\",\"operation\":\"kvnipjoxz\",\"description\":\"chgejspodm\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"eho\",\"isDataAction\":false,\"display\":{\"provider\":\"uxinpmqnjaq\",\"resource\":\"xj\",\"operation\":\"r\",\"description\":\"vcputegj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"t\",\"isDataAction\":true,\"display\":{\"provider\":\"pjhulsuuvmkj\",\"resource\":\"k\",\"operation\":\"f\",\"description\":\"iodjp\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"pvwryoqpsoacc\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListMockTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListMockTests.java deleted file mode 100644 index 1e6ae6924f24..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.azurestackhci.AzureStackHciManager; -import com.azure.resourcemanager.azurestackhci.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"pjflcxogao\",\"isDataAction\":true,\"display\":{\"provider\":\"nsikvmkqzeqqkdl\",\"resource\":\"zxmhhvhgu\",\"operation\":\"odkwobd\",\"description\":\"xtibqdxbxwakbog\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateLinuxConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateLinuxConfigurationTests.java deleted file mode 100644 index f4fcbb658c7e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateLinuxConfigurationTests.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.OsProfileUpdateLinuxConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class OsProfileUpdateLinuxConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OsProfileUpdateLinuxConfiguration model = - BinaryData - .fromString("{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":false}") - .toObject(OsProfileUpdateLinuxConfiguration.class); - Assertions.assertEquals(true, model.provisionVMAgent()); - Assertions.assertEquals(false, model.provisionVMConfigAgent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OsProfileUpdateLinuxConfiguration model = - new OsProfileUpdateLinuxConfiguration().withProvisionVMAgent(true).withProvisionVMConfigAgent(false); - model = BinaryData.fromObject(model).toObject(OsProfileUpdateLinuxConfiguration.class); - Assertions.assertEquals(true, model.provisionVMAgent()); - Assertions.assertEquals(false, model.provisionVMConfigAgent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateTests.java deleted file mode 100644 index 4bdcba95c497..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateLinuxConfiguration; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateWindowsConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class OsProfileUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OsProfileUpdate model = - BinaryData - .fromString( - "{\"computerName\":\"xyawj\",\"linuxConfiguration\":{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":true},\"windowsConfiguration\":{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":false}}") - .toObject(OsProfileUpdate.class); - Assertions.assertEquals("xyawj", model.computerName()); - Assertions.assertEquals(true, model.linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(true, model.linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.windowsConfiguration().provisionVMConfigAgent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OsProfileUpdate model = - new OsProfileUpdate() - .withComputerName("xyawj") - .withLinuxConfiguration( - new OsProfileUpdateLinuxConfiguration().withProvisionVMAgent(true).withProvisionVMConfigAgent(true)) - .withWindowsConfiguration( - new OsProfileUpdateWindowsConfiguration() - .withProvisionVMAgent(true) - .withProvisionVMConfigAgent(false)); - model = BinaryData.fromObject(model).toObject(OsProfileUpdate.class); - Assertions.assertEquals("xyawj", model.computerName()); - Assertions.assertEquals(true, model.linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(true, model.linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.windowsConfiguration().provisionVMConfigAgent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateWindowsConfigurationTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateWindowsConfigurationTests.java deleted file mode 100644 index 6a82161ef4bf..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/OsProfileUpdateWindowsConfigurationTests.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.OsProfileUpdateWindowsConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class OsProfileUpdateWindowsConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OsProfileUpdateWindowsConfiguration model = - BinaryData - .fromString("{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":true}") - .toObject(OsProfileUpdateWindowsConfiguration.class); - Assertions.assertEquals(true, model.provisionVMAgent()); - Assertions.assertEquals(true, model.provisionVMConfigAgent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OsProfileUpdateWindowsConfiguration model = - new OsProfileUpdateWindowsConfiguration().withProvisionVMAgent(true).withProvisionVMConfigAgent(true); - model = BinaryData.fromObject(model).toObject(OsProfileUpdateWindowsConfiguration.class); - Assertions.assertEquals(true, model.provisionVMAgent()); - Assertions.assertEquals(true, model.provisionVMConfigAgent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RoutePropertiesFormatTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RoutePropertiesFormatTests.java deleted file mode 100644 index 66e73df2b95f..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RoutePropertiesFormatTests.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.fluent.models.RoutePropertiesFormat; -import org.junit.jupiter.api.Assertions; - -public final class RoutePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePropertiesFormat model = - BinaryData - .fromString("{\"addressPrefix\":\"mngnzscxaqw\",\"nextHopIpAddress\":\"chcbonqvpkvlrxnj\"}") - .toObject(RoutePropertiesFormat.class); - Assertions.assertEquals("mngnzscxaqw", model.addressPrefix()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.nextHopIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePropertiesFormat model = - new RoutePropertiesFormat().withAddressPrefix("mngnzscxaqw").withNextHopIpAddress("chcbonqvpkvlrxnj"); - model = BinaryData.fromObject(model).toObject(RoutePropertiesFormat.class); - Assertions.assertEquals("mngnzscxaqw", model.addressPrefix()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.nextHopIpAddress()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTablePropertiesFormatTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTablePropertiesFormatTests.java deleted file mode 100644 index d0a6703eb7ce..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTablePropertiesFormatTests.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.fluent.models.RouteTablePropertiesFormat; -import com.azure.resourcemanager.azurestackhci.models.Route; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RouteTablePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RouteTablePropertiesFormat model = - BinaryData - .fromString( - "{\"routes\":[{\"properties\":{\"addressPrefix\":\"xlzevgbmqjqabcy\",\"nextHopIpAddress\":\"ivkwlzuvccfwnfnb\"},\"name\":\"fionl\"}]}") - .toObject(RouteTablePropertiesFormat.class); - Assertions.assertEquals("fionl", model.routes().get(0).name()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.routes().get(0).addressPrefix()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.routes().get(0).nextHopIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RouteTablePropertiesFormat model = - new RouteTablePropertiesFormat() - .withRoutes( - Arrays - .asList( - new Route() - .withName("fionl") - .withAddressPrefix("xlzevgbmqjqabcy") - .withNextHopIpAddress("ivkwlzuvccfwnfnb"))); - model = BinaryData.fromObject(model).toObject(RouteTablePropertiesFormat.class); - Assertions.assertEquals("fionl", model.routes().get(0).name()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.routes().get(0).addressPrefix()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.routes().get(0).nextHopIpAddress()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTableTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTableTests.java deleted file mode 100644 index 37ff539098fa..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTableTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.Route; -import com.azure.resourcemanager.azurestackhci.models.RouteTable; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RouteTableTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RouteTable model = - BinaryData - .fromString( - "{\"etag\":\"vdfgiotk\",\"name\":\"utqxlngx\",\"type\":\"fgugnxkrxdqmid\",\"properties\":{\"routes\":[{\"properties\":{\"addressPrefix\":\"qdrabhjybigehoqf\",\"nextHopIpAddress\":\"wska\"},\"name\":\"ktzlcuiywg\"},{\"properties\":{\"addressPrefix\":\"gndrvynh\",\"nextHopIpAddress\":\"pphrcgynco\"},\"name\":\"ecfvmm\"}]}}") - .toObject(RouteTable.class); - Assertions.assertEquals("ktzlcuiywg", model.routes().get(0).name()); - Assertions.assertEquals("qdrabhjybigehoqf", model.routes().get(0).addressPrefix()); - Assertions.assertEquals("wska", model.routes().get(0).nextHopIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RouteTable model = - new RouteTable() - .withRoutes( - Arrays - .asList( - new Route() - .withName("ktzlcuiywg") - .withAddressPrefix("qdrabhjybigehoqf") - .withNextHopIpAddress("wska"), - new Route() - .withName("ecfvmm") - .withAddressPrefix("gndrvynh") - .withNextHopIpAddress("pphrcgynco"))); - model = BinaryData.fromObject(model).toObject(RouteTable.class); - Assertions.assertEquals("ktzlcuiywg", model.routes().get(0).name()); - Assertions.assertEquals("qdrabhjybigehoqf", model.routes().get(0).addressPrefix()); - Assertions.assertEquals("wska", model.routes().get(0).nextHopIpAddress()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTests.java deleted file mode 100644 index 294814c6bf3c..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/RouteTests.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.Route; -import org.junit.jupiter.api.Assertions; - -public final class RouteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Route model = - BinaryData - .fromString( - "{\"properties\":{\"addressPrefix\":\"etqgtzxdpnq\",\"nextHopIpAddress\":\"qwxrjfeallnw\"},\"name\":\"bisnja\"}") - .toObject(Route.class); - Assertions.assertEquals("bisnja", model.name()); - Assertions.assertEquals("etqgtzxdpnq", model.addressPrefix()); - Assertions.assertEquals("qwxrjfeallnw", model.nextHopIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Route model = - new Route().withName("bisnja").withAddressPrefix("etqgtzxdpnq").withNextHopIpAddress("qwxrjfeallnw"); - model = BinaryData.fromObject(model).toObject(Route.class); - Assertions.assertEquals("bisnja", model.name()); - Assertions.assertEquals("etqgtzxdpnq", model.addressPrefix()); - Assertions.assertEquals("qwxrjfeallnw", model.nextHopIpAddress()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainerStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainerStatusProvisioningStatusTests.java deleted file mode 100644 index 38283f499408..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainerStatusProvisioningStatusTests.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.Status; -import com.azure.resourcemanager.azurestackhci.models.StorageContainerStatusProvisioningStatus; -import org.junit.jupiter.api.Assertions; - -public final class StorageContainerStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageContainerStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"ijggmebfsiar\",\"status\":\"InProgress\"}") - .toObject(StorageContainerStatusProvisioningStatus.class); - Assertions.assertEquals("ijggmebfsiar", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageContainerStatusProvisioningStatus model = - new StorageContainerStatusProvisioningStatus() - .withOperationId("ijggmebfsiar") - .withStatus(Status.IN_PROGRESS); - model = BinaryData.fromObject(model).toObject(StorageContainerStatusProvisioningStatus.class); - Assertions.assertEquals("ijggmebfsiar", model.operationId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersUpdateRequestTests.java deleted file mode 100644 index 554bcae61611..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageContainersUpdateRequestTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.StorageContainersUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageContainersUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageContainersUpdateRequest model = - BinaryData - .fromString( - "{\"tags\":{\"jrunmpxtt\":\"vpnazzm\",\"bnlankxmyskpb\":\"bh\",\"nrs\":\"enbtkcxywny\",\"lhaaxdbabp\":\"nlqidybyxczf\"}}") - .toObject(StorageContainersUpdateRequest.class); - Assertions.assertEquals("vpnazzm", model.tags().get("jrunmpxtt")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageContainersUpdateRequest model = - new StorageContainersUpdateRequest() - .withTags( - mapOf( - "jrunmpxtt", - "vpnazzm", - "bnlankxmyskpb", - "bh", - "nrs", - "enbtkcxywny", - "lhaaxdbabp", - "nlqidybyxczf")); - model = BinaryData.fromObject(model).toObject(StorageContainersUpdateRequest.class); - Assertions.assertEquals("vpnazzm", model.tags().get("jrunmpxtt")); - } - - // 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/StorageProfileUpdateDataDisksItemTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageProfileUpdateDataDisksItemTests.java deleted file mode 100644 index d8feec5bcaa9..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageProfileUpdateDataDisksItemTests.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.StorageProfileUpdateDataDisksItem; -import org.junit.jupiter.api.Assertions; - -public final class StorageProfileUpdateDataDisksItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageProfileUpdateDataDisksItem model = - BinaryData.fromString("{\"id\":\"aboekqv\"}").toObject(StorageProfileUpdateDataDisksItem.class); - Assertions.assertEquals("aboekqv", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageProfileUpdateDataDisksItem model = new StorageProfileUpdateDataDisksItem().withId("aboekqv"); - model = BinaryData.fromObject(model).toObject(StorageProfileUpdateDataDisksItem.class); - Assertions.assertEquals("aboekqv", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageProfileUpdateTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageProfileUpdateTests.java deleted file mode 100644 index d80c9f4a1731..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/StorageProfileUpdateTests.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.models.StorageProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.StorageProfileUpdateDataDisksItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StorageProfileUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageProfileUpdate model = - BinaryData - .fromString("{\"dataDisks\":[{\"id\":\"p\"},{\"id\":\"jyofdxluusdtto\"}]}") - .toObject(StorageProfileUpdate.class); - Assertions.assertEquals("p", model.dataDisks().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageProfileUpdate model = - new StorageProfileUpdate() - .withDataDisks( - Arrays - .asList( - new StorageProfileUpdateDataDisksItem().withId("p"), - new StorageProfileUpdateDataDisksItem().withId("jyofdxluusdtto"))); - model = BinaryData.fromObject(model).toObject(StorageProfileUpdate.class); - Assertions.assertEquals("p", model.dataDisks().get(0).id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatIpConfigurationReferencesItemTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatIpConfigurationReferencesItemTests.java deleted file mode 100644 index 1a53215e9efe..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatIpConfigurationReferencesItemTests.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.SubnetPropertiesFormatIpConfigurationReferencesItem; -import org.junit.jupiter.api.Assertions; - -public final class SubnetPropertiesFormatIpConfigurationReferencesItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubnetPropertiesFormatIpConfigurationReferencesItem model = - BinaryData - .fromString("{\"ID\":\"uhrzayvvt\"}") - .toObject(SubnetPropertiesFormatIpConfigurationReferencesItem.class); - Assertions.assertEquals("uhrzayvvt", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubnetPropertiesFormatIpConfigurationReferencesItem model = - new SubnetPropertiesFormatIpConfigurationReferencesItem().withId("uhrzayvvt"); - model = BinaryData.fromObject(model).toObject(SubnetPropertiesFormatIpConfigurationReferencesItem.class); - Assertions.assertEquals("uhrzayvvt", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatTests.java deleted file mode 100644 index 42660136fa6e..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetPropertiesFormatTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 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.SubnetPropertiesFormat; -import com.azure.resourcemanager.azurestackhci.models.IpAllocationMethodEnum; -import com.azure.resourcemanager.azurestackhci.models.IpPool; -import com.azure.resourcemanager.azurestackhci.models.IpPoolInfo; -import com.azure.resourcemanager.azurestackhci.models.IpPoolTypeEnum; -import com.azure.resourcemanager.azurestackhci.models.Route; -import com.azure.resourcemanager.azurestackhci.models.RouteTable; -import com.azure.resourcemanager.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SubnetPropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubnetPropertiesFormat model = - BinaryData - .fromString( - "{\"addressPrefix\":\"ummajtjaod\",\"addressPrefixes\":[\"nbdxk\",\"pxokajionp\",\"mexgstxgcp\",\"dg\"],\"ipAllocationMethod\":\"Static\",\"ipConfigurationReferences\":[{\"ID\":\"vdjwzrlovm\"}],\"routeTable\":{\"etag\":\"hijco\",\"name\":\"ctbzaq\",\"type\":\"sycbkbfk\",\"properties\":{\"routes\":[{\"properties\":{\"addressPrefix\":\"xxppofm\",\"nextHopIpAddress\":\"x\"},\"name\":\"jpgd\"},{\"properties\":{\"addressPrefix\":\"c\",\"nextHopIpAddress\":\"xhvpmoue\"},\"name\":\"dzxibqeojnxqbzvd\"},{\"properties\":{\"addressPrefix\":\"wndeicbtwnp\",\"nextHopIpAddress\":\"oqvuhr\"},\"name\":\"f\"}]}},\"ipPools\":[{\"name\":\"dglmjthjqkwp\",\"ipPoolType\":\"vm\",\"start\":\"xmqci\",\"end\":\"vhkhixu\",\"info\":{\"used\":\"topbobjogh\",\"available\":\"w\"}}],\"vlan\":54099605}") - .toObject(SubnetPropertiesFormat.class); - Assertions.assertEquals("ummajtjaod", model.addressPrefix()); - Assertions.assertEquals("nbdxk", model.addressPrefixes().get(0)); - Assertions.assertEquals(IpAllocationMethodEnum.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("vdjwzrlovm", model.ipConfigurationReferences().get(0).id()); - Assertions.assertEquals("jpgd", model.routeTable().routes().get(0).name()); - Assertions.assertEquals("xxppofm", model.routeTable().routes().get(0).addressPrefix()); - Assertions.assertEquals("x", model.routeTable().routes().get(0).nextHopIpAddress()); - Assertions.assertEquals("dglmjthjqkwp", model.ipPools().get(0).name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPools().get(0).ipPoolType()); - Assertions.assertEquals("xmqci", model.ipPools().get(0).start()); - Assertions.assertEquals("vhkhixu", model.ipPools().get(0).end()); - Assertions.assertEquals(54099605, model.vlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubnetPropertiesFormat model = - new SubnetPropertiesFormat() - .withAddressPrefix("ummajtjaod") - .withAddressPrefixes(Arrays.asList("nbdxk", "pxokajionp", "mexgstxgcp", "dg")) - .withIpAllocationMethod(IpAllocationMethodEnum.STATIC) - .withIpConfigurationReferences( - Arrays.asList(new SubnetPropertiesFormatIpConfigurationReferencesItem().withId("vdjwzrlovm"))) - .withRouteTable( - new RouteTable() - .withRoutes( - Arrays - .asList( - new Route().withName("jpgd").withAddressPrefix("xxppofm").withNextHopIpAddress("x"), - new Route() - .withName("dzxibqeojnxqbzvd") - .withAddressPrefix("c") - .withNextHopIpAddress("xhvpmoue"), - new Route() - .withName("f") - .withAddressPrefix("wndeicbtwnp") - .withNextHopIpAddress("oqvuhr")))) - .withIpPools( - Arrays - .asList( - new IpPool() - .withName("dglmjthjqkwp") - .withIpPoolType(IpPoolTypeEnum.VM) - .withStart("xmqci") - .withEnd("vhkhixu") - .withInfo(new IpPoolInfo()))) - .withVlan(54099605); - model = BinaryData.fromObject(model).toObject(SubnetPropertiesFormat.class); - Assertions.assertEquals("ummajtjaod", model.addressPrefix()); - Assertions.assertEquals("nbdxk", model.addressPrefixes().get(0)); - Assertions.assertEquals(IpAllocationMethodEnum.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("vdjwzrlovm", model.ipConfigurationReferences().get(0).id()); - Assertions.assertEquals("jpgd", model.routeTable().routes().get(0).name()); - Assertions.assertEquals("xxppofm", model.routeTable().routes().get(0).addressPrefix()); - Assertions.assertEquals("x", model.routeTable().routes().get(0).nextHopIpAddress()); - Assertions.assertEquals("dglmjthjqkwp", model.ipPools().get(0).name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPools().get(0).ipPoolType()); - Assertions.assertEquals("xmqci", model.ipPools().get(0).start()); - Assertions.assertEquals("vhkhixu", model.ipPools().get(0).end()); - Assertions.assertEquals(54099605, model.vlan()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetTests.java deleted file mode 100644 index a5c21509fd3d..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/SubnetTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.IpAllocationMethodEnum; -import com.azure.resourcemanager.azurestackhci.models.IpPool; -import com.azure.resourcemanager.azurestackhci.models.IpPoolInfo; -import com.azure.resourcemanager.azurestackhci.models.IpPoolTypeEnum; -import com.azure.resourcemanager.azurestackhci.models.Route; -import com.azure.resourcemanager.azurestackhci.models.RouteTable; -import com.azure.resourcemanager.azurestackhci.models.Subnet; -import com.azure.resourcemanager.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SubnetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Subnet model = - BinaryData - .fromString( - "{\"properties\":{\"addressPrefix\":\"fidfvzw\",\"addressPrefixes\":[\"htymw\"],\"ipAllocationMethod\":\"Static\",\"ipConfigurationReferences\":[{\"ID\":\"hwxmnteiwa\"},{\"ID\":\"vkmijcmmxdcuf\"},{\"ID\":\"srp\"}],\"routeTable\":{\"etag\":\"idnsezcxtb\",\"name\":\"gfycc\",\"type\":\"ewmdw\",\"properties\":{\"routes\":[{\"properties\":{},\"name\":\"h\"},{\"properties\":{},\"name\":\"sflnrosfqp\"}]}},\"ipPools\":[{\"name\":\"zzvypyqrimzinp\",\"ipPoolType\":\"vm\",\"start\":\"dkirsoodqxhcr\",\"end\":\"ohjtckw\",\"info\":{\"used\":\"oifiyipjxsqwpgr\",\"available\":\"znorcj\"}},{\"name\":\"snb\",\"ipPoolType\":\"vm\",\"start\":\"bnmo\",\"end\":\"cyshurzafbljjgp\",\"info\":{\"used\":\"qcjm\",\"available\":\"javbqidtqajz\"}},{\"name\":\"l\",\"ipPoolType\":\"vm\",\"start\":\"jkrlkhbzhfepg\",\"end\":\"qex\",\"info\":{\"used\":\"c\",\"available\":\"c\"}}],\"vlan\":1853852705},\"name\":\"rhhbcs\"}") - .toObject(Subnet.class); - Assertions.assertEquals("rhhbcs", model.name()); - Assertions.assertEquals("fidfvzw", model.addressPrefix()); - Assertions.assertEquals("htymw", model.addressPrefixes().get(0)); - Assertions.assertEquals(IpAllocationMethodEnum.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("hwxmnteiwa", model.ipConfigurationReferences().get(0).id()); - Assertions.assertEquals("h", model.routeTable().routes().get(0).name()); - Assertions.assertEquals("zzvypyqrimzinp", model.ipPools().get(0).name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPools().get(0).ipPoolType()); - Assertions.assertEquals("dkirsoodqxhcr", model.ipPools().get(0).start()); - Assertions.assertEquals("ohjtckw", model.ipPools().get(0).end()); - Assertions.assertEquals(1853852705, model.vlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Subnet model = - new Subnet() - .withName("rhhbcs") - .withAddressPrefix("fidfvzw") - .withAddressPrefixes(Arrays.asList("htymw")) - .withIpAllocationMethod(IpAllocationMethodEnum.STATIC) - .withIpConfigurationReferences( - Arrays - .asList( - new SubnetPropertiesFormatIpConfigurationReferencesItem().withId("hwxmnteiwa"), - new SubnetPropertiesFormatIpConfigurationReferencesItem().withId("vkmijcmmxdcuf"), - new SubnetPropertiesFormatIpConfigurationReferencesItem().withId("srp"))) - .withRouteTable( - new RouteTable() - .withRoutes(Arrays.asList(new Route().withName("h"), new Route().withName("sflnrosfqp")))) - .withIpPools( - Arrays - .asList( - new IpPool() - .withName("zzvypyqrimzinp") - .withIpPoolType(IpPoolTypeEnum.VM) - .withStart("dkirsoodqxhcr") - .withEnd("ohjtckw") - .withInfo(new IpPoolInfo()), - new IpPool() - .withName("snb") - .withIpPoolType(IpPoolTypeEnum.VM) - .withStart("bnmo") - .withEnd("cyshurzafbljjgp") - .withInfo(new IpPoolInfo()), - new IpPool() - .withName("l") - .withIpPoolType(IpPoolTypeEnum.VM) - .withStart("jkrlkhbzhfepg") - .withEnd("qex") - .withInfo(new IpPoolInfo()))) - .withVlan(1853852705); - model = BinaryData.fromObject(model).toObject(Subnet.class); - Assertions.assertEquals("rhhbcs", model.name()); - Assertions.assertEquals("fidfvzw", model.addressPrefix()); - Assertions.assertEquals("htymw", model.addressPrefixes().get(0)); - Assertions.assertEquals(IpAllocationMethodEnum.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("hwxmnteiwa", model.ipConfigurationReferences().get(0).id()); - Assertions.assertEquals("h", model.routeTable().routes().get(0).name()); - Assertions.assertEquals("zzvypyqrimzinp", model.ipPools().get(0).name()); - Assertions.assertEquals(IpPoolTypeEnum.VM, model.ipPools().get(0).ipPoolType()); - Assertions.assertEquals("dkirsoodqxhcr", model.ipPools().get(0).start()); - Assertions.assertEquals("ohjtckw", model.ipPools().get(0).end()); - Assertions.assertEquals(1853852705, model.vlan()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDiskStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDiskStatusProvisioningStatusTests.java deleted file mode 100644 index f0c9aa48bd33..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDiskStatusProvisioningStatusTests.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.Status; -import com.azure.resourcemanager.azurestackhci.models.VirtualHardDiskStatusProvisioningStatus; -import org.junit.jupiter.api.Assertions; - -public final class VirtualHardDiskStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualHardDiskStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"cuh\",\"status\":\"Failed\"}") - .toObject(VirtualHardDiskStatusProvisioningStatus.class); - Assertions.assertEquals("cuh", model.operationId()); - Assertions.assertEquals(Status.FAILED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualHardDiskStatusProvisioningStatus model = - new VirtualHardDiskStatusProvisioningStatus().withOperationId("cuh").withStatus(Status.FAILED); - model = BinaryData.fromObject(model).toObject(VirtualHardDiskStatusProvisioningStatus.class); - Assertions.assertEquals("cuh", model.operationId()); - Assertions.assertEquals(Status.FAILED, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksUpdateRequestTests.java deleted file mode 100644 index 561c1138d5ce..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualHardDisksUpdateRequestTests.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.VirtualHardDisksUpdateRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VirtualHardDisksUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualHardDisksUpdateRequest model = - BinaryData - .fromString("{\"tags\":{\"vgyuguos\":\"yqiklbbovplwzb\"}}") - .toObject(VirtualHardDisksUpdateRequest.class); - Assertions.assertEquals("yqiklbbovplwzb", model.tags().get("vgyuguos")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualHardDisksUpdateRequest model = - new VirtualHardDisksUpdateRequest().withTags(mapOf("vgyuguos", "yqiklbbovplwzb")); - model = BinaryData.fromObject(model).toObject(VirtualHardDisksUpdateRequest.class); - Assertions.assertEquals("yqiklbbovplwzb", model.tags().get("vgyuguos")); - } - - // 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/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigTests.java deleted file mode 100644 index b604ba726575..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigTests.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.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig model = - BinaryData - .fromString( - "{\"maximumMemoryMB\":2825151831912713640,\"minimumMemoryMB\":7536256841656348248,\"targetMemoryBuffer\":492744230}") - .toObject(VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.class); - Assertions.assertEquals(2825151831912713640L, model.maximumMemoryMB()); - Assertions.assertEquals(7536256841656348248L, model.minimumMemoryMB()); - Assertions.assertEquals(492744230, model.targetMemoryBuffer()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig model = - new VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig() - .withMaximumMemoryMB(2825151831912713640L) - .withMinimumMemoryMB(7536256841656348248L) - .withTargetMemoryBuffer(492744230); - model = - BinaryData - .fromObject(model) - .toObject(VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig.class); - Assertions.assertEquals(2825151831912713640L, model.maximumMemoryMB()); - Assertions.assertEquals(7536256841656348248L, model.minimumMemoryMB()); - Assertions.assertEquals(492744230, model.targetMemoryBuffer()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesHardwareProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesHardwareProfileTests.java deleted file mode 100644 index b6e98911b1da..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesHardwareProfileTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; -import com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesHardwareProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesHardwareProfile model = - BinaryData - .fromString( - "{\"vmSize\":\"Standard_DS5_v2\",\"processors\":914615331,\"memoryMB\":7495165346064567191,\"dynamicMemoryConfig\":{\"maximumMemoryMB\":2295075824007541561,\"minimumMemoryMB\":4077961902359285386,\"targetMemoryBuffer\":2096880843}}") - .toObject(VirtualMachineInstancePropertiesHardwareProfile.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_DS5_V2, model.vmSize()); - Assertions.assertEquals(914615331, model.processors()); - Assertions.assertEquals(7495165346064567191L, model.memoryMB()); - Assertions.assertEquals(2295075824007541561L, model.dynamicMemoryConfig().maximumMemoryMB()); - Assertions.assertEquals(4077961902359285386L, model.dynamicMemoryConfig().minimumMemoryMB()); - Assertions.assertEquals(2096880843, model.dynamicMemoryConfig().targetMemoryBuffer()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesHardwareProfile model = - new VirtualMachineInstancePropertiesHardwareProfile() - .withVmSize(VmSizeEnum.STANDARD_DS5_V2) - .withProcessors(914615331) - .withMemoryMB(7495165346064567191L) - .withDynamicMemoryConfig( - new VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig() - .withMaximumMemoryMB(2295075824007541561L) - .withMinimumMemoryMB(4077961902359285386L) - .withTargetMemoryBuffer(2096880843)); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesHardwareProfile.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_DS5_V2, model.vmSize()); - Assertions.assertEquals(914615331, model.processors()); - Assertions.assertEquals(7495165346064567191L, model.memoryMB()); - Assertions.assertEquals(2295075824007541561L, model.dynamicMemoryConfig().maximumMemoryMB()); - Assertions.assertEquals(4077961902359285386L, model.dynamicMemoryConfig().minimumMemoryMB()); - Assertions.assertEquals(2096880843, model.dynamicMemoryConfig().targetMemoryBuffer()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItemTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItemTests.java deleted file mode 100644 index ca185d5a5278..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItemTests.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.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem model = - BinaryData - .fromString("{\"id\":\"zq\"}") - .toObject(VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.class); - Assertions.assertEquals("zq", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem model = - new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem().withId("zq"); - model = - BinaryData - .fromObject(model) - .toObject(VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem.class); - Assertions.assertEquals("zq", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileTests.java deleted file mode 100644 index 47c50ed27094..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesNetworkProfileTests.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.util.BinaryData; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesNetworkProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesNetworkProfile model = - BinaryData - .fromString("{\"networkInterfaces\":[{\"id\":\"oqnermclfpl\"},{\"id\":\"oxuscrpabgyepsbj\"}]}") - .toObject(VirtualMachineInstancePropertiesNetworkProfile.class); - Assertions.assertEquals("oqnermclfpl", model.networkInterfaces().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesNetworkProfile model = - new VirtualMachineInstancePropertiesNetworkProfile() - .withNetworkInterfaces( - Arrays - .asList( - new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() - .withId("oqnermclfpl"), - new VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem() - .withId("oxuscrpabgyepsbj"))); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesNetworkProfile.class); - Assertions.assertEquals("oqnermclfpl", model.networkInterfaces().get(0).id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileTests.java deleted file mode 100644 index 6218298622c8..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileTests.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.SecurityTypes; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesSecurityProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesSecurityProfile model = - BinaryData - .fromString( - "{\"enableTPM\":true,\"uefiSettings\":{\"secureBootEnabled\":false},\"securityType\":\"ConfidentialVM\"}") - .toObject(VirtualMachineInstancePropertiesSecurityProfile.class); - Assertions.assertEquals(true, model.enableTpm()); - Assertions.assertEquals(false, model.uefiSettings().secureBootEnabled()); - Assertions.assertEquals(SecurityTypes.CONFIDENTIAL_VM, model.securityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesSecurityProfile model = - new VirtualMachineInstancePropertiesSecurityProfile() - .withEnableTpm(true) - .withUefiSettings( - new VirtualMachineInstancePropertiesSecurityProfileUefiSettings().withSecureBootEnabled(false)) - .withSecurityType(SecurityTypes.CONFIDENTIAL_VM); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesSecurityProfile.class); - Assertions.assertEquals(true, model.enableTpm()); - Assertions.assertEquals(false, model.uefiSettings().secureBootEnabled()); - Assertions.assertEquals(SecurityTypes.CONFIDENTIAL_VM, model.securityType()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileUefiSettingsTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileUefiSettingsTests.java deleted file mode 100644 index 33d7ae7d5c31..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesSecurityProfileUefiSettingsTests.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.VirtualMachineInstancePropertiesSecurityProfileUefiSettings; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesSecurityProfileUefiSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesSecurityProfileUefiSettings model = - BinaryData - .fromString("{\"secureBootEnabled\":true}") - .toObject(VirtualMachineInstancePropertiesSecurityProfileUefiSettings.class); - Assertions.assertEquals(true, model.secureBootEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesSecurityProfileUefiSettings model = - new VirtualMachineInstancePropertiesSecurityProfileUefiSettings().withSecureBootEnabled(true); - model = - BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesSecurityProfileUefiSettings.class); - Assertions.assertEquals(true, model.secureBootEnabled()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileDataDisksItemTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileDataDisksItemTests.java deleted file mode 100644 index 347f240f1861..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileDataDisksItemTests.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.VirtualMachineInstancePropertiesStorageProfileDataDisksItem; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesStorageProfileDataDisksItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileDataDisksItem model = - BinaryData - .fromString("{\"id\":\"adm\"}") - .toObject(VirtualMachineInstancePropertiesStorageProfileDataDisksItem.class); - Assertions.assertEquals("adm", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileDataDisksItem model = - new VirtualMachineInstancePropertiesStorageProfileDataDisksItem().withId("adm"); - model = - BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesStorageProfileDataDisksItem.class); - Assertions.assertEquals("adm", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileImageReferenceTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileImageReferenceTests.java deleted file mode 100644 index 712e59ed2449..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileImageReferenceTests.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.VirtualMachineInstancePropertiesStorageProfileImageReference; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesStorageProfileImageReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileImageReference model = - BinaryData - .fromString("{\"id\":\"rcrgvx\"}") - .toObject(VirtualMachineInstancePropertiesStorageProfileImageReference.class); - Assertions.assertEquals("rcrgvx", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileImageReference model = - new VirtualMachineInstancePropertiesStorageProfileImageReference().withId("rcrgvx"); - model = - BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesStorageProfileImageReference.class); - Assertions.assertEquals("rcrgvx", model.id()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileOsDiskTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileOsDiskTests.java deleted file mode 100644 index bdaa3e83ac30..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileOsDiskTests.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.OperatingSystemTypes; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesStorageProfileOsDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileOsDisk model = - BinaryData - .fromString("{\"id\":\"gomz\",\"osType\":\"Windows\"}") - .toObject(VirtualMachineInstancePropertiesStorageProfileOsDisk.class); - Assertions.assertEquals("gomz", model.id()); - Assertions.assertEquals(OperatingSystemTypes.WINDOWS, model.osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfileOsDisk model = - new VirtualMachineInstancePropertiesStorageProfileOsDisk() - .withId("gomz") - .withOsType(OperatingSystemTypes.WINDOWS); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesStorageProfileOsDisk.class); - Assertions.assertEquals("gomz", model.id()); - Assertions.assertEquals(OperatingSystemTypes.WINDOWS, model.osType()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileTests.java deleted file mode 100644 index 1be2323028a0..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstancePropertiesStorageProfileTests.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.OperatingSystemTypes; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileDataDisksItem; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstancePropertiesStorageProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfile model = - BinaryData - .fromString( - "{\"dataDisks\":[{\"id\":\"uzbpzkafku\"},{\"id\":\"crnwbmeh\"},{\"id\":\"eyvjusrtslhspkde\"},{\"id\":\"aofmxagkvtme\"}],\"imageReference\":{\"id\":\"krh\"},\"osDisk\":{\"id\":\"ljuahaquhcdh\",\"osType\":\"Linux\"},\"vmConfigStoragePathId\":\"laexqp\"}") - .toObject(VirtualMachineInstancePropertiesStorageProfile.class); - Assertions.assertEquals("uzbpzkafku", model.dataDisks().get(0).id()); - Assertions.assertEquals("krh", model.imageReference().id()); - Assertions.assertEquals("ljuahaquhcdh", model.osDisk().id()); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osDisk().osType()); - Assertions.assertEquals("laexqp", model.vmConfigStoragePathId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstancePropertiesStorageProfile model = - new VirtualMachineInstancePropertiesStorageProfile() - .withDataDisks( - Arrays - .asList( - new VirtualMachineInstancePropertiesStorageProfileDataDisksItem().withId("uzbpzkafku"), - new VirtualMachineInstancePropertiesStorageProfileDataDisksItem().withId("crnwbmeh"), - new VirtualMachineInstancePropertiesStorageProfileDataDisksItem() - .withId("eyvjusrtslhspkde"), - new VirtualMachineInstancePropertiesStorageProfileDataDisksItem().withId("aofmxagkvtme"))) - .withImageReference(new VirtualMachineInstancePropertiesStorageProfileImageReference().withId("krh")) - .withOsDisk( - new VirtualMachineInstancePropertiesStorageProfileOsDisk() - .withId("ljuahaquhcdh") - .withOsType(OperatingSystemTypes.LINUX)) - .withVmConfigStoragePathId("laexqp"); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstancePropertiesStorageProfile.class); - Assertions.assertEquals("uzbpzkafku", model.dataDisks().get(0).id()); - Assertions.assertEquals("krh", model.imageReference().id()); - Assertions.assertEquals("ljuahaquhcdh", model.osDisk().id()); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osDisk().osType()); - Assertions.assertEquals("laexqp", model.vmConfigStoragePathId()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceStatusProvisioningStatusTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceStatusProvisioningStatusTests.java deleted file mode 100644 index 826a7bb00342..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceStatusProvisioningStatusTests.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.Status; -import com.azure.resourcemanager.azurestackhci.models.VirtualMachineInstanceStatusProvisioningStatus; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstanceStatusProvisioningStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstanceStatusProvisioningStatus model = - BinaryData - .fromString("{\"operationId\":\"wgxhn\",\"status\":\"Succeeded\"}") - .toObject(VirtualMachineInstanceStatusProvisioningStatus.class); - Assertions.assertEquals("wgxhn", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstanceStatusProvisioningStatus model = - new VirtualMachineInstanceStatusProvisioningStatus().withOperationId("wgxhn").withStatus(Status.SUCCEEDED); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstanceStatusProvisioningStatus.class); - Assertions.assertEquals("wgxhn", model.operationId()); - Assertions.assertEquals(Status.SUCCEEDED, model.status()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdatePropertiesTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdatePropertiesTests.java deleted file mode 100644 index aee25e92da90..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdatePropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 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.HardwareProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateLinuxConfiguration; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateWindowsConfiguration; -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.VmSizeEnum; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstanceUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstanceUpdateProperties model = - BinaryData - .fromString( - "{\"hardwareProfile\":{\"vmSize\":\"Standard_NV12\",\"processors\":724820131,\"memoryMB\":4284842638181152780},\"storageProfile\":{\"dataDisks\":[{\"id\":\"cqibycnojv\"},{\"id\":\"mefqsgzvahapjyzh\"}]},\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"cjrvxdjzlmwlxkv\"},{\"id\":\"fhzovawjvzunluth\"},{\"id\":\"prnxipeil\"}]},\"osProfile\":{\"computerName\":\"uaejxdultsk\",\"linuxConfiguration\":{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":true},\"windowsConfiguration\":{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":false}}}") - .toObject(VirtualMachineInstanceUpdateProperties.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_NV12, model.hardwareProfile().vmSize()); - Assertions.assertEquals(724820131, model.hardwareProfile().processors()); - Assertions.assertEquals(4284842638181152780L, model.hardwareProfile().memoryMB()); - Assertions.assertEquals("cqibycnojv", model.storageProfile().dataDisks().get(0).id()); - Assertions.assertEquals("cjrvxdjzlmwlxkv", model.networkProfile().networkInterfaces().get(0).id()); - Assertions.assertEquals("uaejxdultsk", model.osProfile().computerName()); - Assertions.assertEquals(true, model.osProfile().linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(true, model.osProfile().linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.osProfile().windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.osProfile().windowsConfiguration().provisionVMConfigAgent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstanceUpdateProperties model = - new VirtualMachineInstanceUpdateProperties() - .withHardwareProfile( - new HardwareProfileUpdate() - .withVmSize(VmSizeEnum.STANDARD_NV12) - .withProcessors(724820131) - .withMemoryMB(4284842638181152780L)) - .withStorageProfile( - new StorageProfileUpdate() - .withDataDisks( - Arrays - .asList( - new StorageProfileUpdateDataDisksItem().withId("cqibycnojv"), - new StorageProfileUpdateDataDisksItem().withId("mefqsgzvahapjyzh")))) - .withNetworkProfile( - new NetworkProfileUpdate() - .withNetworkInterfaces( - Arrays - .asList( - new NetworkProfileUpdateNetworkInterfacesItem().withId("cjrvxdjzlmwlxkv"), - new NetworkProfileUpdateNetworkInterfacesItem().withId("fhzovawjvzunluth"), - new NetworkProfileUpdateNetworkInterfacesItem().withId("prnxipeil")))) - .withOsProfile( - new OsProfileUpdate() - .withComputerName("uaejxdultsk") - .withLinuxConfiguration( - new OsProfileUpdateLinuxConfiguration() - .withProvisionVMAgent(true) - .withProvisionVMConfigAgent(true)) - .withWindowsConfiguration( - new OsProfileUpdateWindowsConfiguration() - .withProvisionVMAgent(true) - .withProvisionVMConfigAgent(false))); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstanceUpdateProperties.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_NV12, model.hardwareProfile().vmSize()); - Assertions.assertEquals(724820131, model.hardwareProfile().processors()); - Assertions.assertEquals(4284842638181152780L, model.hardwareProfile().memoryMB()); - Assertions.assertEquals("cqibycnojv", model.storageProfile().dataDisks().get(0).id()); - Assertions.assertEquals("cjrvxdjzlmwlxkv", model.networkProfile().networkInterfaces().get(0).id()); - Assertions.assertEquals("uaejxdultsk", model.osProfile().computerName()); - Assertions.assertEquals(true, model.osProfile().linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(true, model.osProfile().linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.osProfile().windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.osProfile().windowsConfiguration().provisionVMConfigAgent()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdateRequestTests.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdateRequestTests.java deleted file mode 100644 index 459ade25ed46..000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/test/java/com/azure/resourcemanager/azurestackhci/generated/VirtualMachineInstanceUpdateRequestTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 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.HardwareProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.Identity; -import com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdate; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateLinuxConfiguration; -import com.azure.resourcemanager.azurestackhci.models.OsProfileUpdateWindowsConfiguration; -import com.azure.resourcemanager.azurestackhci.models.ResourceIdentityType; -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 com.azure.resourcemanager.azurestackhci.models.VmSizeEnum; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineInstanceUpdateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInstanceUpdateRequest model = - BinaryData - .fromString( - "{\"properties\":{\"hardwareProfile\":{\"vmSize\":\"Standard_NV6\",\"processors\":97995700,\"memoryMB\":4253810910381406422},\"storageProfile\":{\"dataDisks\":[{\"id\":\"hfxobbcswsrtj\"}]},\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"bpbewtghfgb\"},{\"id\":\"gw\"},{\"id\":\"vlvqhjkbegi\"},{\"id\":\"nmxiebwwaloayqc\"}]},\"osProfile\":{\"computerName\":\"tzjuzgwyzmhtxo\",\"linuxConfiguration\":{\"provisionVMAgent\":false,\"provisionVMConfigAgent\":false},\"windowsConfiguration\":{\"provisionVMAgent\":true,\"provisionVMConfigAgent\":false}}},\"identity\":{\"principalId\":\"qpsrknftguvri\",\"tenantId\":\"prwmdyvxqt\",\"type\":\"SystemAssigned\"}}") - .toObject(VirtualMachineInstanceUpdateRequest.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_NV6, model.properties().hardwareProfile().vmSize()); - Assertions.assertEquals(97995700, model.properties().hardwareProfile().processors()); - Assertions.assertEquals(4253810910381406422L, model.properties().hardwareProfile().memoryMB()); - Assertions.assertEquals("hfxobbcswsrtj", model.properties().storageProfile().dataDisks().get(0).id()); - Assertions.assertEquals("bpbewtghfgb", model.properties().networkProfile().networkInterfaces().get(0).id()); - Assertions.assertEquals("tzjuzgwyzmhtxo", model.properties().osProfile().computerName()); - Assertions.assertEquals(false, model.properties().osProfile().linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.properties().osProfile().linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.properties().osProfile().windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.properties().osProfile().windowsConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInstanceUpdateRequest model = - new VirtualMachineInstanceUpdateRequest() - .withProperties( - new VirtualMachineInstanceUpdateProperties() - .withHardwareProfile( - new HardwareProfileUpdate() - .withVmSize(VmSizeEnum.STANDARD_NV6) - .withProcessors(97995700) - .withMemoryMB(4253810910381406422L)) - .withStorageProfile( - new StorageProfileUpdate() - .withDataDisks( - Arrays.asList(new StorageProfileUpdateDataDisksItem().withId("hfxobbcswsrtj")))) - .withNetworkProfile( - new NetworkProfileUpdate() - .withNetworkInterfaces( - Arrays - .asList( - new NetworkProfileUpdateNetworkInterfacesItem().withId("bpbewtghfgb"), - new NetworkProfileUpdateNetworkInterfacesItem().withId("gw"), - new NetworkProfileUpdateNetworkInterfacesItem().withId("vlvqhjkbegi"), - new NetworkProfileUpdateNetworkInterfacesItem().withId("nmxiebwwaloayqc")))) - .withOsProfile( - new OsProfileUpdate() - .withComputerName("tzjuzgwyzmhtxo") - .withLinuxConfiguration( - new OsProfileUpdateLinuxConfiguration() - .withProvisionVMAgent(false) - .withProvisionVMConfigAgent(false)) - .withWindowsConfiguration( - new OsProfileUpdateWindowsConfiguration() - .withProvisionVMAgent(true) - .withProvisionVMConfigAgent(false)))) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)); - model = BinaryData.fromObject(model).toObject(VirtualMachineInstanceUpdateRequest.class); - Assertions.assertEquals(VmSizeEnum.STANDARD_NV6, model.properties().hardwareProfile().vmSize()); - Assertions.assertEquals(97995700, model.properties().hardwareProfile().processors()); - Assertions.assertEquals(4253810910381406422L, model.properties().hardwareProfile().memoryMB()); - Assertions.assertEquals("hfxobbcswsrtj", model.properties().storageProfile().dataDisks().get(0).id()); - Assertions.assertEquals("bpbewtghfgb", model.properties().networkProfile().networkInterfaces().get(0).id()); - Assertions.assertEquals("tzjuzgwyzmhtxo", model.properties().osProfile().computerName()); - Assertions.assertEquals(false, model.properties().osProfile().linuxConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.properties().osProfile().linuxConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(true, model.properties().osProfile().windowsConfiguration().provisionVMAgent()); - Assertions.assertEquals(false, model.properties().osProfile().windowsConfiguration().provisionVMConfigAgent()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } -}